Subject Again, "Malformed String" with TIBOQuery
Author Chuck Belanger
Hi, Jason:

I'm sending you a DB which you can use to reproduce this problem to you
personal email. It is about 5+ mb, zipped.

In IB_SQL, Cursor:

ISC ERROR CODE:335544321

ISC ERROR MESSAGE:
arithmetic exception, numeric overflow, or string truncation
Cannot transliterate character between character sets

STATEMENT:
frmSQL.crEdit(TIB_Cursor)

In XE2 IDE, program:
ISC ERROR CODE:335544849
Malformed String

Here's the query: (use 1487 for sesid param)
NOTE: using ml.ml_item works fine to bring up a product that uses the
Registered Trademark symbol, but if you use the remmed out line, it
throws the error.

Again, it does this in the program which is using 5.0+ beta and in
IB_SQL (I believe I recompiled it using 5+), but not in IB_Expert SQL
Editor.

Like the other time with the DB of a different program but it was using
Spanish names in a patient table. This time it is clearly the trademark
character that is causing the problem. I tried a number of different
character sets NONE, ASCII, WIN1251, 1252, etc; none helped.

Thanks for looking into this.

Chuck Belanger

SELECT p.SES_ID, p.REC_ID, p.CAT_ID,
p.Dose, p.Freq, p.Freq_Unit, p.Duration,
p.Sell_Duration, p.Remaining_Duration, p.Dose_min,
p.Dose_Max, p.Sequence, p.When_To_Take,
ml.ml_item
/*F_LTRIM(SUBSTRING(IIF( r.Group_ID = -1, 'PROTOCOL-> ',
IIF(p.CAT_ID = -1, '('||g.group_name||') ', mfr.Company ||
F_Character(32)|| c.mfr_cat_id || F_Character(32))) ||
ml.ml_item FROM 1 FOR 512)) as ML_ITEM*/
, r.Group_ID
, c.Dispensing_UOM
, p.comment, p.Dur_Unit, p.Include
, cv.CV_Description
from PTXCAT p
Join Recommendations r ON p.rec_id = r.Rec_ID
Join MasterLibrary ml ON r.ml_id = ml.ml_id
LEFT OUTER Join Catalog c ON p.Cat_ID = c.Cat_ID
LEFT OUTER Join Manufacturer mfr ON c.mfr_ID = mfr.mfr_ID
LEFT OUTER Join Custom_View cv on r.CV_ID = cv.CV_ID
left Outer Join groups g on r.group_id = g.group_id
WHERE p.Ses_ID = :sesid
/*and r.rec_ID <> 113*/
AND p.Include = 1