Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: escape character???
Quotes need to be doubled in sql*plus.
The condition should read
'be in (''1'',''2'')'
This should do the trick
Hth,
Sybrand Bakker, Oracle DBA
Zhao Fu wrote:
> I am inserting a string which contains single quotation marks to a
> VARCHAR2 type column, the string is like 'be in('1','2')'
>
> In SQL*PLUS, I set the escape character to '\', so my SQL statement is
> like this:
>
> insert into test_a_spec
> (action,condition)
> values('be', 'be in (\'1\',\'2\')');
>
> But I still got the error:
>
> 'be in ('1','2')'
> *
> ERROR at line 4:
> ORA-00917: missing comma
>
> Could anyone point me a direction to solve the problem?
>
> Thank you in advance.
> --
> Zhao Fu
Received on Sat Dec 26 1998 - 15:40:16 CST