I haven't tried it, so take this with a grain or three of salt, but 2 things
stand out:
1) Start x at 1, not 0, and
2) You probably have to use the Evaluate() function around the i[x] bit as
in:
replace(Evaluate("getreg.#i#[#x#]"),"'", "''","all")
Again, untested.
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/
> -----Original Message-----
> From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 10, 2003 3:52 PM
> To: CF-Talk
> Subject: Is there a good way to do this?
>
>
> I need to replace all single quotes with double single quotes in
> all of the
> fields of a query. I know that I could do it in a query but in
> this case I
> am opting not to.
>
>
> I have come up with this idea of but I am having a problem with the "i[x]"
> part. Any ideas?
>
> <cfoutput query="getreg" >
> <cfset x=0 >
> <cfloop index="i" list="#columnlist#">
> <cfset temp= QuerySetCell(getreg, i,
> replace(i[x],"'", "''","all"), x ) >
> <cfset x=x+1 >
> </cfloop>
> </cfoutput>
>
>
>
> Mark W. Breneman
> -Macromedia Certified ColdFusion Developer
> -Network / Web Server Administrator
> Vivid Media
> [EMAIL PROTECTED]
> www.vividmedia.com
> 608.270.9770
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4