[comp.databases] need help with INGRES ESQLC inquire_ingres stmt

beverly@ai.cs.wisc.edu (Beverly Seavey (-Kung)) (08/31/90)

 In an ESLQC (SQL embedded in C) program I was getting an error on
 a select (control was transferred as a result of a EXEC SQL WHENEVER
 ERROR GOTO...   statement, to a diagnostic statement) so I added 
 a couple of lines:

	 EXEC SQL INQUIRE_INGRES (:error_buf = ERRORTEXT);
	 printf (\nSQL Error:\n  %s\n", error_buf);

 After adding these 2 lines I can no longer preprocess, I get an
 error msg:

	 Error #19141 : (Syntax) 
	 Syntax error on "(".


 I copied the 2 lines out of version 6 documentation, though we are running
 some version 5. I have included the SQLCA #include.

 Any insights as to what is wrong?
 .

robf@squid.rtech.com (Robert Fair) (09/04/90)

beverly@ai.cs.wisc.edu (Beverly Seavey (-Kung)) has problems using the
ESQL INQUIRE_INGRES statement, getting a syntax error. The problem is
actually clear in the posting:

>I copied the 2 lines out of version 6 documentation, though we are running
>some version 5. I have included the SQLCA #include.

In Ingres 5.0, the normal way to get status information in ESQL was 
through the standard SQLCA structure or using COPY SQLERROR, so there
was no  INQUIRE_INGRES statement for ESQL back then.
(In 5.0 INQUIRE_EQUEL/INGRES was used by Embedded QUEL and ABF/4GL 
 as a way to get status information, since these languages didn't have 
 an SQLCA)

In Ingres 6.X, INQUIRE/SET_INGRES was added to ESQL for those who prefer
it to the SQLCA - as well as adding support for new features which didn't
fit in the SQLCA (transaction use, DBMS messages, session ids etc)

There are many changes/new features in Ingres 6.X ESQL, from Dynamic SQL 
through Select loops, so its probably not a good idea trying to 
use Ingres 5.0 with 6.X manuals.

Robert Fair
Premium support group
Ingres Corporation, NJ

Standard disclaimer: This posting expresses personal opinions only, and in
no way represents Ingres Corp,.