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!

CAST WITH PRECISION

3520605Aug 14 2017 — edited Aug 14 2017

Hi,

I working in a migration of the Firebird database to Oracle. I have many procedures(codified in the database) to convert.

In this particular case i have problems(this is just an example):

Example 1) select cast('1' as number(4,2)) from dual; -- this works;

Example 2)

create or replace function ft_teste return integer as

begin

    if (cast('1' as number(3,2)) = 1) then return 1; -- THIS DONT WORK - PLS-00103 ERROR.

    else return 0;

    end if;

end;

My question is: why inside a if condition or a attribution expression, a cast with precision dont work.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2017
Added on Aug 14 2017
9 comments
1,027 views