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!

Problem in INSTR function

user1692585Mar 26 2013 — edited Mar 26 2013
Hi All

I'm trying to run the code and running into trouble

CREATE OR REPLACE PROCEDURE TEST (
P_USER IN VARCHAR2,
P_PLANT_ID OUT VARCHAR2
)
IS
vUser VARCHAR2 (10) := P_USER; -->> P_USER can be any thing like YAHOO,INDIA,LANDON
BEGIN
vUser := SUBSTR (vUser, 1, INSTR (vUser, '''', 2));


INSTR (vUser, '''', 2) -- > this part is creating problem, its returning 0 only, not sure what is '''' in INSTR (vUser, '''', 2).

can anyone please help to to reframe the INSTR (vUser, '''', 2), so that it will return proper value, Like for YAHOO it must be 5, LANDON - 6, just don't want to use LENGTH function.

thanks is advance for help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2013
Added on Mar 26 2013
6 comments
1,224 views