<cfparam name="form.size1qty" value="">
...
<cfquery ...
....
<cfqueryparam cfsqltype="cf_sql_numeric" value="#form.size1qty#"
null="#YesNoFormat(NOT Len(form.size1qty))#">
...
Pascal
> -----Original Message-----
> From: Robert Munn [mailto:[EMAIL PROTECTED]
> Sent: 28 July 2004 20:22
> To: CF-Talk
> Subject: Re: HELP - having trouble with a insert query.
>
> You are making this way to hard on yourself. Try something like this
to
> clean up your code and give yourself easier debugging. Also, make sure
all
> of your fields are numeric, or add quotes around inserted values as
> necessary. The "color" field, for instance, is that numeric or text?
>
> <!--- isnull.cfm --->
> <cfscript>
> function isNull(myvar){
> if(isdefined(myvar))
> return evaluate(myvar);
> else
> return "NULL";
> }
> </cfscript>
> <!--- end isnull.cfm --->
>
>
> <!--- insert.cfm --->
>
> <cfinclude template="isnull.cfm">
>
> <cfquery name="addLine" datasource="absappa_costmod">
> INSERT INTO tblOEOrderDetails
> (orderID, styleNumber, sizeScaleID, color,
unitPrice,
> lineTotal
>
,size1qty,size2qty,size3qty,size4qty,size5qty,size6qty)
> VALUES (
> #FORM.orderID#, #FORM.styleNumber#,
#FORM.sizeScaleID#,
> #FORM.color#, #FORM.unitPrice#, #FORM.lineTotal#
> ,#isNull("form.size1qty")#
> ,#isNull("form.size2qty")#
> ,#isNull("form.size3qty")#
> ,#isNull("form.size4qty")#
> ,#isNull("form.size5qty")#
> ,#isNull("form.size6qty")#
> )
> </cfquery>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

