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!

clob and varchar comparision

User508999-OCAug 5 2016 — edited Aug 5 2016

Hi

I have the below tables.

table group ( group_name clob)

table users ( user_id varchar2(100),group_name varchar2(100))

The group_name in table group  is enclosed and comma separated  long list object e.g    'g1','g2,'g3,'g4','g5'.....'g500'

I am writing the below pl/sql block to select the user_id's associated with the group names -I am unable to compare the varchar and clob columns. can we use clob column for comparision. 

declare

user_csv clob;

for cursor1 in ( select group_name from  group)

loop

select user_id into user_csv from users where group_name in ( cursor1.group_name);

PL/SQL: ORA-00932: inconsistent datatypes: expected - got CLOB

I need to get the user_id's in LIST_AGG format. Any help will be much appreciated .

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2016
Added on Aug 5 2016
12 comments
1,385 views