In this;

<cfqueryparam cfsqltype="cf_sql_date" value="#CreateODBCDateTime(Now())#"/>

CreateODBCDateTime() is unnecessary.

Also;

<cfqueryparam cfsqltype="cf_sql_integer"
value="#Trim(FORM.Contributed)#" null="#IIF(Trim(FORM.Contributed) EQ
'', true, false)#">

can be reduced to this

<cfqueryparam cfsqltype="cf_sql_integer"
value="#Trim(FORM.Contributed)#" null="#Trim(FORM.Contributed) EQ
''#">

--
WSS4CF - WS-Security framework for CF
http://wss4cf.riaforge.org/



On 13 November 2010 03:30, David Moore <dgmoor...@hotmail.com> wrote:
>
> Seems to me that there is a lot more to cfqueryparam than I have been 
> utilizing. I built the following query using as many elements of cfqueryparam 
> as I could find based on examples from CF-Talk and other resources. I would 
> love to get expert opinion from those on this forum in an effort to expand my 
> knowledge and provide documentation for others. Code is for MS Access:
>
>  <cfquery name="insNewRecord" datasource="#DSN#">
>    INSERT INTO Database (Active, Contributed, DateAdded, AddedBy, UUID
>        , ParentRecord, PageReference, RecordName, RecordText, ImageFile
>        , DateTaken, TakenBy, PlaceTaken, ProjectReference)
>    VALUES (<cfqueryparam cfsqltype="cf_sql_integer" value="#FORM.Active#"/>
>      , <cfqueryparam cfsqltype="cf_sql_integer" 
> value="#Trim(FORM.Contributed)#" null="#IIF(Trim(FORM.Contributed) EQ '', 
> true, false)#">
>        , <cfqueryparam cfsqltype="cf_sql_date" 
> value="#CreateODBCDateTime(Now())#"/>
>        , <cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#getUser.EmailAddress#"/>
>        , <cfqueryparam cfsqltype="cf_sql_varchar" value="#Trim(FORM.UUID)#" 
> maxlength="255"/>
>        , <cfqueryparam cfsqltype="cf_sql_integer" 
> value="#Trim(FORM.ParentRecord)#">
>        , <cfqueryparam cfsqltype="cf_sql_integer" 
> value="#Trim(FORM.PageReference)#">
>        , <cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#Trim(FORM.RecordName)#" maxlength="255"/>
>        , <cfqueryparam cfsqltype="cf_sql_clob" 
> value="#Trim(FORM.RecordText)#"/>
>        , <cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#Trim(FORM.ImageFile)#" maxlength="255"/>
>        , <cfqueryparam cfsqltype="cf_sql_date" value="#Trim(FORM.DateTaken)#"
> null="#IIF(Trim(FORM.DateTaken) EQ '', true, false)#">
>        , <cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#Trim(FORM.TakenBy)#" null="#IIF(Trim(FORM.TakenBy) EQ '', true, 
> false)#" maxlength="255">
>        , <cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#Trim(FORM.PlaceTaken)#" null="#IIF(Trim(FORM.PlaceTaken) EQ '', 
> true,false)#" maxlength="255">
>        , <cfqueryparam cfsqltype="cf_sql_integer" 
> value="#Trim(URL.ProjectID)#">)
>  </cfquery>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339174
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to