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!

user defined data types in cast functions

holdingJun 22 2010 — edited Jun 22 2010
Hi,

I am migrating sybase to oracle database. A Java developer needs money datatypes.I said to them, please change the cast(<value> as number(19,4) in java code side. but they are not accepted because money data type is used most of the places.

select cast(0 as money) from bank_trans; this sql statements present in java code. I need to create user defined type is equivalent to money datatype.

My steps


I have create user defined data types

create or replace type money as object(money as numbeer(19,4)

select cast(0 as money) from dual;

it shows inconsistent datatypes error.


create or replace type money is table of numbeer(19,4);

select cast(0 as money) from dual;

it shows inconsistent datatypes error.

please give the solution.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2010
Added on Jun 22 2010
2 comments
1,566 views