PL/SQL (MOSC)

MOSC Banner

need to use single quote in procedure input argument while using in select query

edited Jan 18, 2018 4:01AM in PL/SQL (MOSC) 5 commentsAnswered

Hi,

I need to add single quote to my input variable of procedure while using in select query

Code:

create or replace procedure listobj(objnam varchar)

    is

    cursor c1 is

    select object_id,object_name,tablespace_name,owner from dba_objects where object_name=objnam;

    rec c1%rowtype;

    begin

    for rec in c1 loop

    dbms_output.put_line(rec.object_id||'  '||rec.tablespace_name||'  '||rec.owner);

    end loop;

   end;

   /

I need to add single quote to my input variable in procedure being used in select query.

<span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; color: #101094;">create</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; color: #303336;"> </span><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; color: #101094;">or</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center