Easy to do if you use cfqueryparam

INSERT INTO tblMember(name,address)
VALUES(
        <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value="#trim(attributes.name)#"
null="#YesNoFormat(Len(Trim(attributes.name)) EQ 0)#">,
        <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value="#trim(attributes.address)#"
null="#YesNoFormat(Len(Trim(attributes.address)) EQ 0)#">
)


> -----Original Message-----
> From: "Luce>,Greg" <[EMAIL PROTECTED] [mailto:"Luce>,Greg"
> <[EMAIL PROTECTED]]
> Sent: Wednesday, February 12, 2003 3:14 PM
> To: CF-Talk
> Subject: SQL Nulls
> 
> 
> Does anyone have any tips to keep SQL from writing form data 
> that's not
> filled in as NULL instead of a space? I've never given this much
> consideration, because Oracle which I started Cfing with puts 
> NULL in a
> field if you do: VALUES('','','') but now I find SQL Server 
> puts a space (or
> something other than null) according to Enterprise Manager.
> 
> I've always done this:
> INSERT INTO tblMember(name,address)
> VALUES('#trim(attributes.name)#','#trim(attributes.address)#')
> But the value it puts for name or address aren't null in Ent. 
> Manager if no
> value is put in the form field. Does a space take more disk 
> space than a
> NULL?
> 
> Greg
> ***Sterling Financial Investment Group, Inc. (SFIG) is a member of
> NASD/MSRB/NFA/SIPC.  Email transmissions may be monitored.  
> SFIG cannot
> accept orders to buy or sell via email.  Please visit 
www.mysterling.com for
more information.***

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to