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!

About CAST function in oracle

1035909Aug 27 2013 — edited Aug 28 2013

Hi ,

Now iam migrating my system from SQL to ORACLE 9i.

Here USERID is of NUMBER(38) type
  and DATA is of LONG type in SQL.

I  have table named :

     PEOPLE  and DBATABLE and i run the following code in oracle but found the following error...

ORA-00932: inconsistent datatypes:

SELECT P.USERID FROM PEOPLE P LEFT OUTER JOIN (SELECT DATA  FROM DBATABLE WHERE NAME='USER' ) R ON CAST(DATA  AS VARCHAR(50))= CAST(P.USERID AS VARCHAR(50)) WHERE P.USERLOGID= 1000 AND R.DATA IS NULL;

So help me for finding my error.
I have missed somewhere but could not find what i missed .

Plz help me out.
With regards,
Namus

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2013
Added on Aug 27 2013
12 comments
2,785 views