Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Unanswered: how to convert BLOB into INT in DB2

    How to convert BLOB into INT in DB2. The native datatype is BLOB and I can convert it to varchar. But I don't know how to convert it again to INT.


    select cast (value as varchar(256)) from tablename
    This converts it to varchar only.


    select cast (cast (value as varchar(256)) as int) from tablename
    This gives me an error: SQL0242N Invalid character found in a character string argument of the function "INTEGER". SQLSTATE=22018


    Does anyone know how to make this conversion work?
    Attached Thumbnails Attached Thumbnails Capture.jpg  

  2. #2
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963

    Question

    Quote Originally Posted by richardabc View Post
    How to convert BLOB into INT in DB2. The native datatype is BLOB and I can convert it to varchar. But I don't know how to convert it again to INT.


    select cast (value as varchar(256)) from tablename
    This converts it to varchar only.


    select cast (cast (value as varchar(256)) as int) from tablename
    This gives me an error: SQL0242N Invalid character found in a character string argument of the function "INTEGER". SQLSTATE=22018


    Does anyone know how to make this conversion work?
    How you think what is the length of integer in DB2
    Last edited by Lenny77; 12-06-12 at 23:44.

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by richardabc View Post
    Does anyone know how to make this conversion work?
    I'm afraid your concept of integer numbers somewhat differs from the one implemented in DB2.
    ---
    "It does not work" is not a valid problem statement.

Tags for this Thread

Posting Permissions

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