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!

Having Problems with CAST Function

583143Dec 20 2007 — edited Dec 20 2007
Hey Guys;

I need to write an SQL statement that does a cast or some type of conversion from a number to a string.

I have tried a number of things and can't get it to work.

Here's what i currently have:

SELECT *
FROM TABLE1
WHERE COLUMN1 = CAST(12345678 AS STRING)

I've tried using CHAR and VARCHAR2 instead of string and it still doesn't work. When i use VARCHAR2 it says i'm missing a left parenthesis and when i use CHAR it says data value out of range. That doesn't make sense to me, because if i put the same value in quotes, it runs fine.

Hope someone can help me out.
thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2008
Added on Dec 20 2007
3 comments
728 views