Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2007
    Posts
    1

    Unanswered: Conversion from smallint to char

    Could anybody say me how to convert smallint value to char ?
    For example if:
    cost.amount - smallint
    print.laber - char

    how I can update print.label with cost.amount. I couldn't find routine for this!
    Help!

    Maya

  2. #2
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    Hi, if you just want to store the value of cost.amount into print.label do:
    Code:
    UPDATE print SET label = 
        (SELECT amount FROM cost WHERE cost.key = print.key)
    WHERE key = ...
    If you want to perform a calculation with both the print.label and cost.amount and you work with IDS 9.x or higher do an explicit cast, like:
    Code:
    SELECT cost.amount + print.label::smallint 
    FROM print, cost
    WHERE ...
    Regards
    Last edited by Tyveleyn; 11-09-07 at 18:56.

Posting Permissions

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