DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 13

Thread: Numeric field

Threaded View

  1. #2
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    You can try the to_number


    SQL> select to_number('A') from dual;
    select to_number('A') from dual
    *
    ERROR at line 1:
    ORA-01722: invalid number


    SQL> ed
    Wrote file afiedt.buf

    1* select to_number('10') from dual
    SQL> /

    TO_NUMBER('10')
    ---------------
    10 function

    1 declare
    2 l_number number;
    3 begin
    4 select to_number('A') into l_number from dual;
    5 exception
    6 when invalid_number then
    7 dbms_output.put_line('Invalid Number');
    8* end;
    SQL> /

    PL/SQL procedure successfully completed.

    SQL> set serveroutput on
    SQL> /
    Invalid Number

    PL/SQL procedure successfully completed.


    regards
    Hrishy
    Last edited by hrishy; 02-24-2004 at 06:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width