-
Is it possible do use a variable instead of a hard-coded value to do a LIKE in PL/SQL? For example, something like
i_string char(10) := '%ABC%'
SELECT count(*) INTO i_cnt FROM table WHERE column LIKE i_string;
That particular syntax doesn't work, and neither do any of the other ways I've tried. I know I can do it with NDS, but I'd rather not unless I have to.
Thanks,
Vince
-
Either modify i_string char(10) := '%ABC%'
to i_string varchar2(10) := '%ABC%'
or
modify the select to
SELECT count(*) INTO i_cnt FROM table WHERE column LIKE rtrim(i_string);
If you use char, the value in i_string is actually '%ABC '
(10 characters !!!!! )
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
|