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 for ...LIKE '%01%';

goodluck247Aug 23 2016 — edited Aug 23 2016

Hello all,

I have a procedure where I select some data, and in the WHERE clause, instead of hard-coding the search criterium like this:

     ... where custno = p_custno and

                   tests_done like '%01%';

I would like to pass a varchar2 variable like this:

     ... p_test := '01';

     ... exec my_proc(p_custno, p_test);

and then in the procedure:

     ... where custno = p_custno and

                   tests_done like '%||p_test||%';

But it doesn't seem to be working. What am I doing wrong?

Thank you.

This post has been answered by CarlosDLG on Aug 23 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2016
Added on Aug 23 2016
7 comments
1,034 views