Results 1 to 4 of 4

Thread: number to char

  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Exclamation Unanswered: number to char

    Hi,

    I have a value at number and need to convert this number to char, there are some statement or function for this.

    thank you for you hep.

    greetings

  2. #2
    Join Date
    Feb 2005
    Posts
    33
    try this:
    select concat('',yourcolumn) ...

    then you can put further string functions around it:
    select substr(concat('',yourcolumn),1,3) as youraliasname ...

  3. #3
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Thank you for you help,

    You can tell me the systax it completes.

    thank you.

  4. #4
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    Georgipa,

    From IDS 9.x up you can use the builtin cast functionality, like integer::char(x) or CAST(integer AS char(x)). Thus you can use string functions around it like:
    Code:
    SELECT length(integer::varchar(10))
    FROM table
    Works more straightforward than concatenation or other functions...

    BTW. If you're talking about Informix 4GL: implicit casts are done by assigning a numeric value to a character variable so nothing special has to be done.

    Regards

Posting Permissions

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