Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    10

    Unanswered: How do i convert VARCHAR to INT in DB2

    Hello All

    I would like to have a script that would convert VARCHAR to INT in DB2

    I am new to Db2 and any help will be of great help to me

    Thanks

    Gautam S

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: How do i convert VARCHAR to INT in DB2

    Originally posted by gsinha
    Hello All

    I would like to have a script that would convert VARCHAR to INT in DB2

    I am new to Db2 and any help will be of great help to me

    Thanks

    Gautam S
    Look at INTEGER() function
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can also use:

    CAST(column-name AS INT)

    But you will get a data exception error if the value is not numeric.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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