Converting data types using SQL

C

ciojr

I have a table that has a column that is a data type of "LONG". The
data in this column is actually text (it's descriptions). Don't know
they history of why it was set up this way, but I cannot change it.
So, I am trying to use SQL to pull this column along with other
columns in the table. In my where clause I need to use the column in
question (which is called "service_description", for example) to limit
the data I am pulling back. However, SQL does not allow me to use the
CAST or CONVERT or SUBSTR functions to convert the data in the field.
I get the error ORA-00997: illegal use of LONG datatype or ORA-00932:
inconsistent datatypes: expected NUMBER got LONG or some other ORACLE
error.
Is there some way to do this? I cannot change the data type of the
column, so I have to convert the data in the sql in order to use it in
my where clause.
Thanks.

select *
from table_definitions
where service_description = 'TBD';
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

I have a table that has a column that is a data type of "LONG". The
data in this column is actually text (it's descriptions). Don't know
they history of why it was set up this way, but I cannot change it.
So, I am trying to use SQL to pull this column along with other
columns in the table. In my where clause I need to use the column in
question (which is called "service_description", for example) to limit
the data I am pulling back. However, SQL does not allow me to use the
CAST or CONVERT or SUBSTR functions to convert the data in the field.
I get the error ORA-00997: illegal use of LONG datatype or ORA-00932:
inconsistent datatypes: expected NUMBER got LONG or some other ORACLE
error.
Is there some way to do this? I cannot change the data type of the
column, so I have to convert the data in the sql in order to use it in
my where clause.
Thanks.

select *
from table_definitions
where service_description = 'TBD';

This has nothing to do with C++, try an Oracle group, such as
comp.databases.oracle.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top