What happens if you double up your single quotes?

For example:

vals="sq_pat.nextval,#mcn_id#,#foundry#,#package#,#dieconfig#,#productid#,#project_alias#,#technology#,#sirev#,''#comment#'',1,0">

Dave

-- 

David M. Delbridge
Circa 3000
ColdFusion Hosting
http://www.circa3k.com


Ray Regno wrote:
> 
>   I'm kinda stumped on this problem I've been having:
> 
> [excerpt from dspPatInsertConfirm.cfm]
> <cfset tabName="pat">
> <cfset cols="(pid, mcn, foundry, package, dieconfig, productid,
> project_alias, technology, sirev, user_comment, username, flag)">
> <cfset
> vals="sq_pat.nextval,#mcn_id#,#foundry#,#package#,#dieconfig#,#productid#,#project_alias#,#technology#,#sirev#,'#comment#',1,0">
> <cfinclude template="actInsertToTable.cfm">
> 
> [excerpt from actInsertToTable.cfm]
>   <cfquery datasource="#app.dsname#" name="insert_#tabName#">
>     insert into tab_#tabName# #cols# values (#vals#)
>   </cfquery>
> 
> This is basically a generic means of inserting values into tables. I have
> this working for table that only have numeric values. It seems to choke on
> the comment field above which is a string. Here is the error message I get:
> 
> ODBC Error Code = S1000 (General error)
> [MERANT][ODBC Oracle 8 driver][Oracle 8]ORA-00917: missing comma
> SQL = "insert into tab_pat (pid, mcn, foundry, package, dieconfig,
> productid, project_alias, technology, sirev, user_comment, username, flag)
> values (sq_pat.nextval,9,2,2,2,1,1,2,1,''I AM EDITED COPYlkjk'',1,0)"
> 
> I tried cutting and pasting that SQL into a command line and it appears
> that the quotes around the "I AM EDITED COPYlkjk" is actually two single
> quotes in series rather than double quotes. it gave an error on the
> commandline. When I removed the extra single quote it worked on the command
> line. I'm not sure how to fix this. I thought maybe that the sql statement
> was inserting extra single quotes for the string, but when i took them out
> in dspPatInsertConfirm.cfm it choked again. Any ideas on how to fix this?
> Has anyone been able to successfully create a generic insert script?
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

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

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to