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!

how to put single quotes

ReemaPuriJul 11 2016 — edited Jul 12 2016

MY QUERY IS like that

CREATE OR REPLACE function org_id

return varchar2

as

l_return varchar2(1000);

begin

select listagg(org_id,',')

within group  ( order by org_id) into l_return

from hrms_org_struct where ORG_DEPT_NAME NOT

                  IN ('Marketing','IT-Support','HRM','Administration',

                     'Accounts and Finance','PS Sales','Training Sales',

                     'Tool Sales');

return l_return ;

end ;

declare

l_return varchar2(1000);

begin

l_return := org_id();

dbms_output.put_line(l_return);

end;

which return numbers like this

ORG_ID

561,553,552,551,550,549,548,547,546,545,544,543,542,541

which function should i use to return like this

'561','553','552','551','550','549','548','547','546','545','544','543','542','541'

This post has been answered by Marwim on Jul 11 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2016
Added on Jul 11 2016
10 comments
3,311 views