[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Error handling on commit



> > I am using SQR v3 in UNIX on an Oracle database.  I want to be able to gracefully exit the SQR program after a failed commit
> > command but it appears that SQR doesn't provide the capability to check the return status from a commit command.  Is this true?
> > Would the reserved variable #sqr-status hold the return status from a commit command, or is it only for a begin-select
> > statement?  I would appreciate any information or suggestions.
[...]
> If you use your commit within a begin-sql paragraph, any error that
> occurred due to the commit would be held in the $sql-error system
> variable and you can specify an ON-ERROR procedure to run on the
> begin-sql line. Hope this helps.

Note that (at least in v3), the SQR manual states you should not use COMMIT
within a begin-sql paragaph (page 133, under the "COMMIT" command ).  I
think this is because SQR needs to know that a commit has happened in order
to keep its own internal processing in sync with the database's.  I have a
feeling that this is more important for some databases than for others.
(For example, some databases close all open cursors on a COMMIT, others
don't.)

Unfortunately, I don't know of any way to trap errors that happen with SQR's
COMMIT command, so you may need to try it in a begin-sql and see if that
causes any SQR errors down the line....


                                                        Nathan

----------------------------------------------------------------------------
Nathan Treadway    | Ray Ontko & Co. | Software consulting services
nathant@ontko.com  | Richmond, IN    | http://www.ontko.com/