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!

From CLOB to varchar2(4000)

YoavSep 10 2011 — edited Sep 11 2011
Hi,
SQL> create  table my_statments
  2  (sql_id varchar2(30) ,
  3    sql_fulltext  varchar2(4000));
  
Table created.
Now i am trying to substr 3999 from the sql_fulltext column which is CLOB and populate the table sql_fulltext
SQL>    insert into  my_statments
  2    select distinct sql_id , substr(sql_fulltext,1,3999) 
  3    from v$sql
  4    where sql_id in (
  5  '3zd39g7skdyta',
  6  'aztm7a667vhm5',
  7  'bm33zv9wnn4kf',
  8  '2dh925pv3x1z0',
  9  'b4mkzn7q29s1h',
 10  'gh9tfm9hc2czn',
 11  '2gxapkw7uxtax',
 12  '4g37u166322jf',
 13  'gmbbcp3qzcjtr')
 14  ;
  select distinct sql_id , substr(sql_fulltext,1,3999)
                           *
ERROR at line 2:
ORA-00932: inconsistent datatypes: expected - got CLOB
Please advice how to do it

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2011
Added on Sep 10 2011
8 comments
2,007 views