johnny@edvvie.at (Johann Schweigl) (09/15/89)
I use(d) PRO*C to write a shell interface to ORACLE RDBMS. The only problem
I have (asides the errors in my PRO*C Manual) is how to get the parse
error offset into an erroneous SQL statement.
No way with PRO*C, the only possibility is to use the HLI library with
the following code:
void syntaxError(stm,uid,pwd)
char *stm;
char *uid;
char *pwd;
{
static char lda[64]; /* private logon data area */
static cursor cda; /* cursor data area */
static int rc; /* return code */
/* the following minus error checking */
rc = olon(lda,uid,pwd); /* log on to ORACLE, a second time */
rc = oopen(&cda,lda); /* open a cursor for the stm */
rc = osql3(&cda,stm,-1); /* parse it */
fprintf(stderr,"%s\n",stm);
fprintf(stderr,"%*s\n",cda.csrpeo + 1,"^");
}
There are two inconveniences.
First, I have to log on to ORACLE a second time (the first time by
EXEC SQL CONNECT ...).
Second, I have to create a new cursor for a statement, that has already
a cursor assigned to it.
Question: The precompiler generates calls to a undocumented library.
I think that the library calls do set up a logon and cursor data area
internally, because the kernel requires them.
Now, is anybody out there, probably at ORACLE, who can tell me how
(* UNSUPPORTED and UNDOCUMENTED, of course) to access these ?
Any hints will be appreciated.
Thanks in advance.
--
------------------------------------------------------------------
EDV Ges.m.b.H Vienna Johann Schweigl
Hofmuehlgasse 3 - 5 USENET: johnny@edvvie.at
A-1060 Vienna, Austria Tel: (0043) (222) 59907 257 (8-19 CET)