i would use somehting like this...

<CFSET fred = ListToArray(myList)>

<CFLOOP INDEX="bob" FROM="2" TO="ArrayLen(fred)" STEP="2">
<CFQUERY...>
UPDATE customer
SET receiptNo = '#fred[bob-1]#'
WHERE Cust_Code = '#fred[bob]#'
</CFQUERY>

</CFLOOP>


that should do you.  of course, change variable names as you see fit. :)

Chris Olive
DOHRS Website Administrator
[EMAIL PROTECTED]


-----Original Message-----
From: aslam bajaria [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 03, 2000 3:05 PM
To: [EMAIL PROTECTED]
Subject: One question about list parsing


I have the following task to do:

I have a list that is like

111111111, abc,
747466464, jdj,
484848848, utd,

... and so on.

What I have to do is write a script that looks like:

update table customer
set receiptNo = '1111111111'
where Cust_Code='abc'

update table customer
set receiptNo='747466464'
where Cust_Code='utd'

... and so on.

The list is a text file. Is there a way to parse this
list by saying that whenever it encounters ','(comma)
sign, goto where clause, then for the second ',' sign
goto the set clause.

What is the best way of parsing the file if there was
no comma. Supposing the list was like:

1111111111 abc
7474664564 xyz

etc.

Is there a built in function in ColdFusion to parse
the list in this way.

Appreciate it.
A Bajaria

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to