Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Oracle error msgs back to PowerBuilder app

Status
Not open for further replies.

ChrisCurzon

IS-IT--Management
Sep 8, 2008
1
US

We have a PowerBuilder application connecting to an Oracle database. The app uses PowerScript to send SQL to the database. The app also uses data windows (with SQL queries as the data source) to interact with the database.

It might happen that a SQL statement (either in PowerScript or supporting a data window) fails for any of a number of reasons. For example the user might not have privilege to SELECT from a table. Or the data may violate an integrity constraint.

I need to know whether it is possible...

1) To trap a SQL error in PowerScript without crashing the PowerBuilder application. Also, is it possible to fetch the FULL error message text so that application can write it to a session log file?

2) To trap an error from SQL supporting a data window without crashing the PowerBuilder application. Is it possible in this case to fetch the FULL error message text so that application can write it to a session log file?

Right now, it seems as though SQL which supports a data window causes the entire application to crash, if there is a database error. And it seems as though SQL which is used in PowerScript only shows part of the error message text, not all of it.

Any help, example code, concepts, references, would be appreciated. I will pass it onto the PB app programmer.

Thanks in advance,

Chris Curzon
 
Have you tried checking the SQLCA object (transaction object) for error codes and/or error messages immediately after the sql call? (this is elementary error checking to prevent the crashes you describe).

Matt

"Nature forges everything on the anvil of time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top