Skip to Main Content

SQL Developer

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!

SqlDeveloper Reports, Bind variable in IN condition and multiple values

Regis LevesqueDec 12 2017 — edited Dec 13 2017

Hi

I created a User Defined Reports base on the Data Dictionnary Reports - Column Comments.

I made a change in the where clause to use a IN condition to get only the table needed. (SqlQuery below)

When using the IN condition directly, i.e  IN ('tablename1','tablename2'), it work perfectly.

Now, I would like to use a bind variable.

Using simply tablename1 work great.

Unfortunately trying to use more that one values i.e. tablename1, tablename2, I can't achieved it.

After spending on hour googling, I didn't find an answer.

Then hopefully,  someone will be able to find an answer.

Thank you

SELECT c.owner     "Owner",

      c.table_name  "Table_Name",

      c.column_name "Column_Name",

      c.comments    "Comments",

      c.owner        sdev_link_owner,

      c.table_name   sdev_link_name,

      t.table_type   sdev_link_type

FROM sys.all_col_comments c,

      sys.all_tab_comments t

WHERE c.owner = user

  AND c.owner = t.owner

  AND c.table_name = t.table_name

  AND (:TABLE_NAME_LIST IS NULL OR

       INSTR(UPPER(c.table_name),UPPER(:TABLE_NAME_LIST)) > 0)

  AND (:COLUMN_NAME IS NULL OR

       INSTR(UPPER(c.column_name),UPPER(:COLUMN_NAME)) > 0)

  AND SUBSTR(c.table_name,1,4) != 'BIN$'

  AND SUBSTR(c.table_name,1,3) != 'DR$'

AND UPPER(T.TABLE_NAME) IN (UPPER(:TABLE_NAME_LIST))

ORDER BY c.owner, c.table_name, c.column_name

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2018
Added on Dec 12 2017
10 comments
2,555 views