-
Why the following will not work? isn't the backslach a escape character?
SQL> insert into test3 values('good', '\'bad\'');
insert into test3 values('good', '\'bad\'')
*
ERROR at line 1:
ORA-00917: missing comma
SQL> insert into test3 values('good',''bad'');
insert into test3 values('good',''bad'')
*
ERROR at line 1:
ORA-00917: missing comma
SQL>
-
If your intention is to insert 'bad' , try '''bad''' or chr(39)||'bad'||chr(39)
-
/demo/cdwprod/SQL>insert into temp values ('"Good"');
1 row created.
/demo/cdwprod/SQL>select * from temp;
TMP
--------------------
"Good"
Have Fun
Naveen
-
in the middle of a string, use two single quotes next to each other to include a single quote in a string. For example:
declare X varchar2(1000);
begin
X := 'This is kmesser''s string'; - between the r and s are two single quotes
insert into kmessertable values(X);
X := ''''; -- that is four single quotes in a row, which will result in one, single quote being stored in X as a varchar2 value;
insert into kmesstable values(X);
end;
-
Thanks! using two single quotes works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|