(<cfqueryparam value="#getRecord_qry.memo#" cfsqltype="cf_sql_varchar" />)
On Fri, Jun 27, 2008 at 1:59 PM, Roberto Perez <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I do not know what keywords I could use to investigate this in the archives,
> so I'll describe the issue and hopefully you'll be able to tell be if this
> topic has been covered before.
>
> I'm querying a DB and, if a record is found, I'm inserting that information
> (slightly edited) as a new record. For the insert part, I have this:
>
> INSERT INTO TableName_tb
> (memo)
> VALUES
> ('#getRecord_qry.memo#')
>
>
> ....where getRecord_qry is the name of the initial query where I got the
> record from.
>
> My issue is the following: if that memo field includes an apostrophe, that
> will confuse CF during the INSERT process and I get this error: "Syntax error
> (missing operator) in query expression" and then it quotes the first 255
> characters in my memo field, including the offending quote. The error message
> disappears if I get rid of the apostrophe manually.
>
> I have used SELECT before to get that same record from that same table and
> display it on the screen, and that works fine (apostrophe included). I can
> use an input box and type single quotes as I enter information, and that
> works fine too. But when the result of the query is placed directly in an
> INSERT statement, the apostrophe seems to be a problem (and I'm wondering now
> how many other characters could also throw a similar error).
>
> Except using a replace function to get rid of the apostrophes (I'd need to
> copy the memo field as is, apostrophes and all), what else could I do to
> maybe format the "memo" string, encode it, whatever, to be used in an INSERT
> statement?
>
> Thanks in advance,
>
> Roberto
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308264
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4