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!

insert character string with a character string of its own into a varchar2 column

goodluck247Feb 14 2017 — edited Feb 14 2017

Hello all,

The task is to insert the following data into a varchar2 column:

     create table a (aa number, ab number, ac varchar2(2000));

     insert into a values(135, 2212, 'where auto = 'F'');

Obviously, the following error occurs:

     SQL Error: ORA-00917: missing comma

I tried this:

     insert into a values(135, 2212, 'where auto = q'['F']'');

and it didn't work:

     SQL Error: ORA-00917: missing comma

and I tried this:

     insert into a values(135, 2212, 'where auto = q''F''');

but the result was wrong:

     select * from a;

     135    2212    where auto = q'F'

Could you please help with this insert?

Thank you.

This post has been answered by mathguy on Feb 14 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2017
Added on Feb 14 2017
10 comments
857 views