Home » SQL & PL/SQL » SQL & PL/SQL » Decode is not using CLOB as its argument :ORA-00932
icon5.gif  Decode is not using CLOB as its argument :ORA-00932 [message #127513] Tue, 12 July 2005 00:44 Go to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
hi all,
i am using 9i ,but when running a query having decode and its argument is a CLOB value,it gives an error ORA-00932 inconsistent data type,expected - got CLOB.

But if i change this CLOB variable to varchar2 then decode is working properly.

Thanks
Dinesh
Re: Decode is not using CLOB as its argument :ORA-00932 [message #127524 is a reply to message #127513] Tue, 12 July 2005 01:35 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Not sure !!!!


Try with Case ... When ... Then.

Rajuvan
Re: Decode is not using CLOB as its argument :ORA-00932 [message #127551 is a reply to message #127513] Tue, 12 July 2005 03:05 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9106
Registered: November 2002
Location: California, USA
Senior Member
You can use DBMS_LOB.SUBSTR to return a varchar2 that DECODE can handle, as shown below.

scott@ORA92> CREATE TABLE clob_tab
  2    (clob_col CLOB)
  3  /

Table created.

scott@ORA92> INSERT INTO clob_tab (clob_col) VALUES ('test')
  2  /

1 row created.

scott@ORA92> SELECT DECODE (clob_col, 'test', 'match', 'no match')
  2  FROM   clob_tab
  3  /
SELECT DECODE (clob_col, 'test', 'match', 'no match')
               *
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CLOB


scott@ORA92> SELECT DECODE (DBMS_LOB.SUBSTR (clob_col, 30), 'test', 'match', 'no match')
  2  FROM   clob_tab
  3  /

DECODE(D
--------
match

scott@ORA92>

Re: Decode is not using CLOB as its argument :ORA-00932 [message #127554 is a reply to message #127551] Tue, 12 July 2005 03:27 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
Thanks barbara,
Its is working for all the cases except in one case

It is throwing ORA-06502 ERROR. numeric or value error.

Thanks
Dinesh
Re: Decode is not using CLOB as its argument :ORA-00932 [message #127679 is a reply to message #127554] Tue, 12 July 2005 18:01 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9106
Registered: November 2002
Location: California, USA
Senior Member
What is that one case? Please post the code.
Re: Decode is not using CLOB as its argument :ORA-00932 [message #127755 is a reply to message #127679] Wed, 13 July 2005 02:55 Go to previous message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
Thanks to all,
We have solved that one.


With regards
Dinesh
Previous Topic: IN/OUT parms
Next Topic: Error ORA-06502
Goto Forum:
  


Current Time: Wed Jul 30 06:30:41 CDT 2025