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

Thread: column validation

  1. #1
    Join Date
    May 2003
    Location
    Philippines
    Posts
    3

    column validation

    Hi,

    I want to validate a column in my table which is varchar2 type and
    should contain numeric values only. My tables is just a staging area
    so all columns have varchar2 types.

    There is a cobol command which validates fields: Ex. "if is numeric". Is there a similar command in PL/SQL?

    Thanks in advance.

  2. #2
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Are you looking for something like following ?

    Code:
    SQL> select to_number('a') from dual;
    select to_number('a') from dual
           *
    ERROR at line 1:
    ORA-01722: invalid number
    
    
    SQL> select to_number('2') from dual;
    
    TO_NUMBER('2')
    --------------
                 2
    -- Dilip

  3. #3
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434

    Re: column validation

    Originally posted by eva_2003
    Hi,

    I want to validate a column in my table which is varchar2 type and
    should contain numeric values only. My tables is just a staging area
    so all columns have varchar2 types.
    If u want only number .. define it as number?

    why go for varchar?

    well if its staging area.. so wat?
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

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