Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting actual error string with ODBC to Oracle

Re: Getting actual error string with ODBC to Oracle

From: Justin Cave <jocave_at_yahoo.com>
Date: 17 Sep 2002 04:22:56 -0700
Message-ID: <233b7a65.0209170322.35c0b180@posting.google.com>


You can certainly get this info from OCI, look for the attribute OCI_ATTR_PARSE_ERROR_OFFSET. I don't believe that the ODBC protocol allows you to retrieve this information.

Justin Cave

"Kevin" <Log.In_at_Comcast.Net> wrote in message news:<am6bv8$33vpu$1_at_ID-142050.news.dfncis.de>...
> If I use SQLPlus, I can type in some 'bad' SQL and it gives me this:
>
> 1 select
> 2 joe
> 3 from
> 4* a_lot_at_operation
> 5 /
> joe
> *
> ERROR at line 2:
> ORA-00904: invalid column name
>
> I'm using Oracle ODBC driver to execute my SQL, and all I get is the last
> error message (that there is an invalid column name, but no indication of
> where in the SQL the error actually exists). Obviously SQLPlus gets some
> information back about what line and text 'column' the error is at.
>
> Do anyone know how to get that same information (line & text column) via
> ODBC? [I've tried the SQLError, SQLGetDiagRec and SQLGetDiagField
> functions, but still only get the basic error message.]
>
> Thanks in advance for any help. If you reply to this, please copy me via
> email as well.
>
> /kjs
>
> ps- or conversely, if you know that OCI supports this functionality, I'd be
> interested also.
Received on Tue Sep 17 2002 - 06:22:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US