Problem: When a program, which uses the InterBase API, is run it returns the error arithmetic exception, numeric overflow, or string truncation -Cannot transliterate character between character sets on the isc_dsql_execute(...) function call. Solution: This has to do with the use of an XSQLDA structure. When the structure is setup by hand a length for the variable must be given. If it is not then this error will be produced when the statement is executed. Here is the code example that does NOT work: /* setup the XSQLDA input vars */ sqlIn->sqlvar[0].sqldata = firm; sqlIn->sqlvar[0].sqltype = SQL_TEXT; sqlIn->sqlvar[1].sqldata = alert; sqlIn->sqlvar[1].sqltype = SQL_TEXT; /* execute the statement */ isc_dsql_execute(isc_status, &trans, &stmt, 1, sqlIn); To fix this the length of the 2 input char strings must be set. here is the correct code that includes the setting of the length: /* setup the XSQLDA input vars */ sqlIn->sqlvar[0].sqldata = firm; sqlIn->sqlvar[0].sqltype = SQL_TEXT; sqlIn->sqlvar[0].sqllen = strlen(firm); sqlIn->sqlvar[1].sqldata = alert; sqlIn->sqlvar[1].sqltype = SQL_TEXT; sqlIn->sqlvar[1].sqllen = strlen(alert); /* execute the statement */ isc_dsql_execute(isc_status, &trans, &stmt, 1, sqlIn);
Last Modified: 17-OCT-00