-
CAST without errors
I am porting an application that currently hits MS SQL Server to Oracle. In one method, it generates sql to cast values from a column to another type, specified by the user.
This works in MS SQL, because there CAST will return NULL if the conversion is invalid. The values that can be converted get converted, and those that don't simply become NULL. In Oracle, the statement simply returns an error that it can't cast the value.
Is there a way to emulate the MS SQL behavior in Oracle?
-
You could wrap the CAST function up in a user-defined PL/SQL function to do this. The function can trap the errors
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|