If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Conversion from smallint to char

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-08-07, 11:22
mayapaskaleva mayapaskaleva is offline
Registered User
 
Join Date: Nov 2007
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 11-09-07, 17:47
Tyveleyn Tyveleyn is offline
Registered User
 
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 17:56.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On