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 > CASTing fails

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-06, 04:33
PascalGR PascalGR is offline
Registered User
 
Join Date: Oct 2006
Posts: 8
CASTing fails

Hi all,

I'm trying to migrate an Informix database to DB2 and there's some tables that contain varchar fields with Greek characters.

When I want do fetch such fields in AS/400 I use the following SELECT statement:

SELECT CAST (CAST (field1 AS VARCHAR(100) FOR BIT DATA) AS CHAR(100) CCSID 875) AS field1 FROM table1

I'm not keen with Informix, even the following simple statement I've run just to see how CASTing works in Informix, fails (and I don't know why):

SELECT CAST(field1 AS VARCHAR) from table1

Is any equivalent in Informix that does the same? Or is any other way (with example plz ) to correctly convert greek characters?

Thanks & Regards,
Pascal
Reply With Quote
  #2 (permalink)  
Old 12-18-06, 11:46
Tyveleyn Tyveleyn is offline
Registered User
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 248
Try specifying the maximum length of the VARCHAR column, i.e. like VARCHAR(255). The absolute maximum size of a VARCHAR column is 255 bytes when not indexed. When indexed it's 254 bytes.

Regards.
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