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 to compare two table rows having clob column

New RootsJul 28 2017 — edited Aug 2 2017

I have two tables with similar structure in two different schema . I want to compare tab1 records with tab2 . "Minus" operations failed to clob columns in the table.

So what is the best way to compare two tables with colb columns.

WITH tab1(sno,sname,detail_clob,prd_info)AS

  (SELECT 1,'prd1',to_clob('this is test clob content1'),'invent1' FROM dual

   UNION ALL

   SELECT 2,'prd2',to_clob('this is test clob content2'),'invent2' FROM dual

  ),

  tab2(sno,sname,detail_clob,prd_info)AS

  (SELECT 1,'prd1',to_clob('this is test clob content1'),'invent1' FROM dual

  )

SELECT * FROM tab1

MINUS

SELECT * FROM tab2;

ORA-00932: inconsistent datatypes: expected - got CLOB

00932. 00000 -  "inconsistent datatypes: expected %s got %s"

*Cause:   

*Action:

Error at Line: 9 Column: 8

Expected output:

SNO  SNAME     DETAIL_CLOB                  PRD_INFO

2    prd2    this is test clob content2     invent2

This post has been answered by RogerT on Jul 28 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2017
Added on Jul 28 2017
7 comments
3,734 views