Jump to content

Doubt In Sql -- Urgent


Recommended Posts

Posted

I have a table which has a column with datatype CLOB

if i call in a query saying ...

select A from tblemployees ------------> where A is column with datatype clob

its giving the result

but when i call this query with join with another tables its saying that [size=4]ORA-00932: inconsistent datatypes: expected - got CLOB[/size]
[size=4]00932. 00000 - "inconsistent datatypes: expected %s got %s"[/size]

[size=4]Ex: [/size]


[size=4]select A,B,C [/size][size=4] from Tblemployees join tblclass join tblnumber [/size]

[size=4]should i add anything prefix to the column name....plz help [/size]

Posted

when u r joining both needs to be same datatype i guess... try convert...

Posted

Can u write the query properly??
Join tblclass --- it should follow with what columns u are joining on
same for tblnumber as well...
U are joining tables only....where is the column on which the join is being operated..
If not it will give cartesian product?? Is that what you are looking??

Posted

[code]select cast(clobcolumn as Varchar(max)) as clobcolumn
FROM table_name;[/code]

Posted

[quote name='loveindia' timestamp='1376426653' post='1304111078']
[code]select cast(clobcolumn as Varchar(max)) as clobcolumn
FROM table_name;[/code]
[/quote]

If u do this, I think it will limit the field to 4k characters only...It will truncate the remaining text more than 4k characters as per my knowledge..correct me if I am wrong...

Posted

[quote name='rajivn786' timestamp='1376426860' post='1304111100']

If u do this, I think it will limit the field to 4k characters only...It will truncate the remaining text more than 4k characters as per my knowledge..correct me if I am wrong...
[/quote]


Varchar(max) is 8000
if it is more than that use Nvarchar(max) which can be a good fit...

Posted

[quote name='rajivn786' timestamp='1376426496' post='1304111057']
Can u write the query properly??
Join tblclass --- it should follow with what columns u are joining on
same for tblnumber as well...
U are joining tables only....where is the column on which the join is being operated..
If not it will give cartesian product?? Is that what you are looking??
[/quote]
Dude joining avani just idea kosam vesanu ...its only with clob column

[quote name='loveindia' timestamp='1376426653' post='1304111078']
[code]select cast(clobcolumn as Varchar(max)) as clobcolumn
FROM table_name;[/code]
[/quote]
[quote name='loveindia' timestamp='1376427396' post='1304111150']


Varchar(max) is 8000
if it is more than that use Nvarchar(max) which can be a good fit...
[/quote]

I did use the above idea with the column name and this is Oracle ...my bad...sql ani topic lo vesanu


this was the error when i am writing the above way



ORA-00910: specified length too long for its datatype
00910. 00000 - "specified length too long for its datatype"
*Cause: for datatypes CHAR and RAW, the length specified was > 2000;
otherwise, the length specified was > 4000.
*Action: use a shorter length or switch to a datatype permitting a
longer length such as a VARCHAR2, LONG CHAR, or LONG RAW
Error at Line: 13 Column: 49

and could add NVarchar2 but no use

Posted

[quote name='loveindia' timestamp='1376427396' post='1304111150']


Varchar(max) is 8000
if it is more than that use Nvarchar(max) which can be a good fit...
[/quote]
column length max is 84

Posted

oracle no idea dude... but this is what i found on google..

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:367980988799

×
×
  • Create New...