ESQL seg faulting, DELIMIDENT?
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
After upgrading from ESQL/C 7.13 to ESQL/C 9.21 (as contained in Client SDK 2.30) for Sun Sparc Solaris 2.6 esql terminates with a segmentation fault while precompiling some of my .ec files. I narrowed down the problem to sql statements such as EXEC SQL prepare stmt_sel_myid from 'SELECT "MyId" FROM "SomeTable" WHERE "SomeField"=?'; The new version of esql doesn't seem to like the double quotes around mixed upper/lower case table and field names, whereas the old version compiled this type of code just fine. The DELIMIDENT environment variable ist set. Strangely enough, if I unset the DELIMIDENT environment variable, esql does not seg fault but instead gives me an error message, as expected! Any ideas what could be wrong? Any new environment variable that has to be set? Any old environment variable that has to be unset? An Informix bug? Any workaround? By the way, don't jump on me because of these stupid mixed upper/lower case table and field names. I inherited the db schema from someone else and have to live with it now... Any help would be greatly appreciated. Cheers E.
Are you certain it is not the single quotes around the SELECT statement that is giving the problem? I remember something about ANSI changing the rules about when single and double quotes can be used and what they imply recently. Try using only double quotes and escaping the quotes around the tablename and other strings or try using single quotes within and double quotes around the entire statement. Art S. Kagel EA wrote: > > After upgrading from ESQL/C 7.13 to ESQL/C 9.21 (as contained in Client SDK > 2.30) for Sun Sparc Solaris 2.6 esql terminates with a segmentation fault > while precompiling some of my .ec files. > I narrowed down the problem to sql statements such as > > EXEC SQL prepare stmt_sel_myid from > 'SELECT "MyId" FROM "SomeTable" > WHERE "SomeField"=?'; > > The new version of esql doesn't seem to like the double quotes around mixed > upper/lower case table and field names, whereas the old version compiled > this type of code just fine. > The DELIMIDENT environment variable ist set. Strangely enough, if I unset > the DELIMIDENT environment variable, esql does not seg fault but instead > gives me an error message, as expected! > > Any ideas what could be wrong? Any new environment variable that has to be > set? Any old environment variable that has to be unset? An Informix bug? Any > workaround? > > By the way, don't jump on me because of these stupid mixed upper/lower case > table and field names. I inherited the db schema from someone else and have > to live with it now... > > Any help would be greatly appreciated. > > Cheers > E.
Still the same problem. Both suggestions (double quotes only with escapes for the table and field names as well as swapping single and double quotes) didn't help, unfortunately. At least esql doesn't seg fault in these cases but rather gives me a syntax error (DELIMIDENT both set and not set). The most recent INFORMIX-ESQL/C Programmer's Manual (Version 9.21, 5423.pdf) did change a bit on page 14-5ff. but still claims that ANSI specifies single quotes for the statement and double quote for the identifiers. Appears to me to be a bug in esql. Strangely enough the most recent version of the client sdk (esql 9.21 TC1) on Windows NT 4 shows the very same behavior - esql crashing with an illegal memory reference. I guess I'll have to escalate this with Informix support... Thanks again and Cheers Eckard Art S. Kagel <kagel@bloomberg.net> wrote in message news:3805E3D6.F790962@bloomberg.net... > Are you certain it is not the single quotes around the SELECT statement > that is giving the problem? I remember something about ANSI changing the > rules about when single and double quotes can be used and what they imply > recently. Try using only double quotes and escaping the quotes around > the tablename and other strings or try using single quotes within and > double quotes around the entire statement. > > Art S. Kagel > > EA wrote: > > > > After upgrading from ESQL/C 7.13 to ESQL/C 9.21 (as contained in Client SDK > > 2.30) for Sun Sparc Solaris 2.6 esql terminates with a segmentation fault > > while precompiling some of my .ec files. > > I narrowed down the problem to sql statements such as > > > > EXEC SQL prepare stmt_sel_myid from > > 'SELECT "MyId" FROM "SomeTable" > > WHERE "SomeField"=?'; > > > > The new version of esql doesn't seem to like the double quotes around mixed > > upper/lower case table and field names, whereas the old version compiled > > this type of code just fine. > > The DELIMIDENT environment variable ist set. Strangely enough, if I unset > > the DELIMIDENT environment variable, esql does not seg fault but instead > > gives me an error message, as expected! > > > > Any ideas what could be wrong? Any new environment variable that has to be > > set? Any old environment variable that has to be unset? An Informix bug? Any > > workaround? > > > > By the way, don't jump on me because of these stupid mixed upper/lower case > > table and field names. I inherited the db schema from someone else and have > > to live with it now... > > > > Any help would be greatly appreciated. > > > > Cheers > > E.