You could carry on the way you are and simply 
<cfset xlocator = listGetAt(session.crtcalid,Indexcount,"^")>

or 

change your loop to a list loop so that the index item will hold each
xlocator item.

or

if you wish to use arrays then take a look at the listToArray()
function.

HTH

Michael Traher 


-----Original Message-----
From: laritru [mailto:[EMAIL PROTECTED] 
Sent: 18 September 2003 18:22
To: CF-Talk
Subject: array help on a query insert loop

<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>
I need help writing an array to dump the values of this cart
(session.crtcalid)so they can loop one at a time and insert in to my
query. Can anyone help me with this? All help will be appreciated. As of
now it tries to insert all the values at once for xlocator which is the
firld that i am using to hold the event id. this is the error. 
ODBC Error Code = 22001 (String data right truncation)<P> [MERANT][ODBC
Oracle 8 driver][Oracle 8]ORA-01401: inserted value too large for column
<P><P> SQL = ""Insert Into     registrar_data.event    (     xstatus,
xdate,     xtime,      xgroup$,     xgroupdate,     xgrouptime,
xcreate,      xupdate,     xuser,     rhas_note$,     xlocator,
xuniquekey,     xorigin,     xnumber     )    Values    (    'E',
to_date('18-Sep-03', 'DD-MON-YY'),    '13:19:38',    'E',
to_date('18-Sep-03', 'DD-MON-YY'),    '13:19:38',
to_date('18-Sep-03', 'DD-MON-YY'),    to_date('18-Sep-03', 'DD-MON-YY'),
'WEB',    '0',    '0000002407^0000002394',    'W00000644',    '01',
'W0000000644'    )"" "
here is what i am inseting to my db. 
<cfset rid="W" & numberformat(getrid.recurid + 1,"0000000000")>
<CFQUERY Name = "AddOrder" Datasource = #application.dsn#> 
  Insert Into registrar_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#'
  )
  </cfquery>
  </cfloop>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137654
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

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to