Thanks for the tip I did checked the db and is not the columns in the table is that my 
loop is not working properly. It is inserting the values of all events chosen in my 
form into one row. This is the original loop I used. This is the one  that causes me 
to get the first error. 
<cfloop index="IndexCount" from="1" To="#ListLen(Session.Crtcalid, "^")#">
<cfoutput>
<cfset xname = #ListGetAt(Session.Crtxname, IndexCount, "^")#>
<cfset ProdQty = #ListGetAt(Session.CrtQuantity, IndexCount, "^")#>
<cfset ProdCost = #ListGetAt(Session.CrtPrice, IndexCount, "^")# * 
#ListGetAt(Session.CrtQuantity, IndexCount, "^")#> 
</cfoutput>  
<CFQUERY Name = "AddItemsToDbase" Datasource = #application.dsn#>
--insert here-----
I went ahead and chaged the loop to the following to see if it got better. 
<cfset num_of_recurs = #Session.Crtcalid#>
<cfloop index="IndexCount" from="1" to="#ListLen(num_of_recurs)#">
<CFQUERY Name = "AddtemsToDbase" Datasource = #application.dsn#>
I have 14 inserts on this query and it keeps inserting all values at once. The session 
crt.calid holds the id for each event but it keeps trying to insert all values in one 
row. How can I break this down so that for each event there is a row added to the db? 
Any ideas how I can set up the loop. 
This is the error that I am getting. 
"Error","3164","09/05/03","10:08:13",,"xxx.xx.xxx.xxx, Mozilla/4.0 (compatible; MSIE 
6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322), TO<P> Cannot convert 
0000002394^0000002408 to number.<P>Please, check the ColdFusion manual for the allowed 
conversions between data types<p>The error occurred while processing an element with a 
general identifier of (CFLOOP), occupying document position (62:1) to 
(62:48).</p><P><P>Date/Time: 09/05/03 10:08:13<BR>Browser: Mozilla/4.0 (compatible; 
MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)<BR>Remote Address: 
xxx.xx.xxx.xxx<BR>HTTP Referrer: http://www.testl.com/cart/testcart.cfm<P>"
[EMAIL PROTECTED] wrote:
check the length of your variables rid, customeridnumber and session.crtcalid against 
the character lenghth of those columns. What the error is telling you is that the 
value you're attempting to insert into a char or varchar field is longer than the 
column allows. 

hth

ike 

------ Original Message ------ 
From: laritru 
To: CF-Talk 
Sent: Sep 04, 2003 09:58 AM
Subject: Re: looping dilema on multiple form inserts

>I am trying to insert multiple records for a form. I am using the code below. My 
>problem is the following. When I am inserting multiple instances of events I get the 
>following error
>"Error","5384","09/03/03","17:10:37",,"172.16.177.115, Mozilla/4.0 (compatible; MSIE 
>6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322), ODBC Error Code = 22001 
>(String data right truncation)

[MERANT][ODBC Oracle 8 driver][Oracle 8]ORA-01401: inserted value too large for column 


The error occurred while processing an element with a general identifier of (CFQUERY), 
occupying document position (73:1) to (73:75).


Date/Time: 09/03/03 17:10:36
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET 
CLR 1.1.4322)
Remote Address: 172.16.177.115
HTTP Referrer: http://www.testone.com/cart/testcart.cfm
"
>
>The problem for me is the following. when i start it the form i set the 
>session.crt.calid with the values you see below. The values that i am trying to loop 
>on multiple events are values that need to go in the db since the table requires 
>fields. Any suggestions?
>
>
>
>
>>#ListGetAt(Session.CrtQuantity, IndexCount, "^")#>
>
>
>
> Insert Into test_data.event
> (
> xstatus,
> xdate,
> xtime,
> xgroup$,
> xgroupdate,
> xgrouptime,
> xcreate,
> xupdate,
> xuser,
> rhas_note$,
> xlocator,
> xuniquekey,
> xorigin,
> xnumber
> )
> Values
> (
> 'E',
> to_date('#DateFormat(now(),"dd-mmm-yy")#', 'DD-MON-YY'),
> '#registertime#',
> 'E',
> to_date('#DateFormat(now(),"dd-mmm-yy")#', 'DD-MON-YY'),
> '#registertime#',
> to_date('#DateFormat(now(),"dd-mmm-yy")#', 'DD-MON-YY'),
> to_date('#DateFormat(now(),"dd-mmm-yy")#', 'DD-MON-YY'),
> 'WEB',
> '0',
> '#Session.Crtcalid#',
> '#CustomerIDNumber#',
> '01',
> '#rid#'
> )
> 
> 
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

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

Reply via email to