But what if you where to change DBs? You would then have to modify more than
you would normally.

============================================
Bryan F. Hogan
Director of Internet Development
Macromedia Certified ColdFusion MX Developer
Digital Bay Media, Inc.
1-877-72DIGITAL
============================================

-----Original Message-----
From: David Fafard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 11:39 AM
To: CF-Talk
Subject: Re: CFQUERYPARAM Grr!


If MS-SQL Server:

FirstName = NULLIF('#Trim(Attributes.FirstName)#', '')

Udates FirstName to the Attributes.FirstName else NULL

Dave


----- Original Message -----
From: "Bryan F. Hogan" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, February 13, 2003 11:26 AM
Subject: RE: CFQUERYPARAM Grr!


> <CFSET Attributes.FirstName=''>
> <CFIF Len(Trim(Attributes.FirstName))>
> <CFSET isNull=0>
> <CFELSE>
> <CFSET isNull=1>
> </CFIF>
> <CFQUERY NAME="TestingNulls" DATASOURCE="#Request.DSN#">
> INSERT INTO tbl_DuesSchedule
> (
> ScheduleName
> )
> values
> (
> <CFQUERYPARAM
> VALUE="#Trim(Attributes.FirstName)#"
> CFSQLTYPE="CF_SQL_CHAR"
> NULL="#Variables.isNull#"
> >
> )
> </CFQUERY>
>
> ============================================
> Bryan F. Hogan
> Director of Internet Development
> Macromedia Certified ColdFusion MX Developer
> Digital Bay Media, Inc.
> 1-877-72DIGITAL
> ============================================
>
> -----Original Message-----
> From: "Everett [mailto:"Everett]
> Sent: Thursday, February 13, 2003 11:19 AM
> To: CF-Talk
> Subject: RE: CFQUERYPARAM Grr!
>
>
> Of course not.
>
> null="#YesNoFormat(Len(Trim(Attributes.firstname)) lt 1)#"
>
> > -----Original Message-----
> > From: "Luce>,Greg" <[EMAIL PROTECTED] [mailto:"Luce>,Greg"
> > <[EMAIL PROTECTED]]
> > Sent: Thursday, February 13, 2003 11:09 AM
> > To: CF-Talk
> > Subject: RE: CFQUERYPARAM Grr!
> >
> >
> > But I can't put this in the cfqueryparam:
> > null="<cfif Len(Trim(Attributes.firstname)) lt 1>Yes<cfelse>No</cfif>"
> > It errors:
> > Attribute NULL in tag CFQUERYPARAM has an invalid value
> >
> > Cannot convert YesNo to boolean.
> >
> > I could put conditional logic around the whole cfqueryparam
> > tag and just put
> > null="Yes" or null="No" but that's kinda ugly.
> >
> > Greg
> >
> > -----Original Message-----
> > From: "Everett>,Al" <[EMAIL PROTECTED] [mailto:"Everett>,Al"
> > <[EMAIL PROTECTED]]
> > Sent: Thursday, February 13, 2003 10:52 AM
> > To: CF-Talk
> > Subject: RE: CFQUERYPARAM
> >
> >
> > Len(Trim(value)) EQ 0
> >
> > If the value doesn't exist, simply use IsDefined()
> >
> > > -----Original Message-----
> > > From: "Luce>,Greg" <[EMAIL PROTECTED] [mailto:"Luce>,Greg"
> > > <[EMAIL PROTECTED]]
> > > Sent: Thursday, February 13, 2003 10:41 AM
> > > To: CF-Talk
> > > Subject: RE: CFQUERYPARAM
> > >
> > >
> > > OK, one more question. If I want it to insert NULL when there
> > > is NOT a value
> > > passed, how can I get the YesNoFormat thing to work. It's
> > > ignoring the value
> > > passed now if the len(trim)) IS gt 0, I want the opposite.
> > >
> > > -----Original Message-----
> > > From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 13, 2003 10:14 AM
> > > To: CF-Talk
> > > Subject: Re: CFQUERYPARAM
> > >
> > >
> > > ,Greg wrote:
> > > > OK, I'm trying to use cfqueryparam on a varchar field
> > > insert and it's
> > > > inserting a "?" even though I'm entering a value in the
> > > form field that's
> > > > posting to this query. Anyone know what's wrong here?
> > > >
> > > > VALUES ('<cfqueryparam value="#Trim(Attributes.firstname)#"
> > > > cfsqltype="CF_SQL_CHAR"
> > > > null="#YesNoFormat(Len(Trim(Attributes.firstname)))#">',...
> > >
> > > No quotes around cfqueryparam. Never.
> > >
> > > Jochem
> > >
> > >
> > >
> >
> >
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

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

Reply via email to