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 do you include static text in select statement in Dynamic pl/sql

331076Sep 18 2002
I want to include some atatic text and get the output of 4 columns joined with a ":" delimiter within them in a select statement built using Dynamic PL/SQL. How do I build it.

e.g.
Normal select statement would be
select 'MY SKU IS : ', col1||':'||col2||':'||col3||':'||col4 from table1 where ....where condition


and output looks like :
MY SKU IS A:B:C:D
MY SKU IS a:b:c:d
....

Dynamically I have -

SQL_Stmt := 'select 'MY SKU IS : ', col1||':'||col2||':'||col3||':'||col4 from table1 where '|| wherecondition;

I understand that this does not work because the single quote terminates the string. But my question is how do I achieve the same result with dynamic PL/SQL ? How do I include the static strings and the delimiters. I have tried using double quote, '\'....
????
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2002
Added on Sep 18 2002
2 comments
3,145 views