Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Escape Character in ODBC Connections?? HELP!

432625Jun 2 2005 — edited Jun 3 2005
Hi All,

I have a problem : we have a C++ app here that is supposed to attach to an Oracle 8i or 9i database here via a standard ODBC connection.

When this app attempts to do something like this:

INSERT INTO MyTable (MyRow) Values('[testing]')

it fails - it does not like the square brackets in the command. when I copy this into SQL Plus, of course, it runs just fine.

the ODBC link also doesn't like this:
INSERT INTO MyTable (MyRow) Values('/[testing/either

or this:
INSERT INTO MyTable (MyRow) Values('[[testing]either

or this:
INSERT INTO MyTable (MyRow) Values('`testing`') either

in fact, it appears the following are all reserved characters that oracle's ODBC driver can't handle:

` ' " \ / [ ]

My questions are :
1) Can I find a definitive list of these (Oracle documentation is good on reserved WORDS, but poor on reserved CHARACTERS)

2) what can I use to set an escape character within my ODBC SQL? Is this something I can tweak on the ODBC DSN cofiguration? I know in SQL*Plus you can just say
SET ESCAPE ON
SET ESCAPE "\"

But you can't do that on every SQL Query getting sent through ODBC can you?

Please help!

I
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2005
Added on Jun 2 2005
9 comments
970 views