PL/SQL (MOSC)

MOSC Banner

PL/SQL-Package and query with single quote and comma

edited Apr 23, 2020 10:43AM in PL/SQL (MOSC) 4 commentsAnswered

Hi all,

I faced to a problem with a query with apostrophe  and single quote.

I want to create a query in this form, e.g.:

Select *

From my_table

where my_col_1 in (:my_variable)

and before that :my_variable (VARCHAR2) will be initialaized:

1- :my_variable := 'content_1'

2- :my_variable := my_variable || ', content_2'

....

finally, query have to be as followed:

Select *

From my_table

--where my_col_1 in (:my_variable)

where my_col_1 in ('content_1','content_2')

But query could not work with ' (apostroph). I get no error, but not the correct answer, that I checked manually.

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