dbaccess to stop script upon error
Posted in 2000
Topics: Server Administration
Hi, Family.
If I run dbaccess interactively - with the menus - I can choose a
script file to run. If it encounters an error, the statement gets
rolled back and the script stops executing right there. So if I have a
10-statement script and it barfs on the 4th statement, only the first
three will have been executed.
By contrast, if I run dbaccess non-interactively:
$ dbaccess yutz yada.sqland it encounters an error, the process continues to execute the
remaining SQL statements in the script. So in the above example, it
will have executed statements 1-3, then 5-10, effectively skipping
statement 4.
I have a situation in which this is not acceptible.
I recall (from this newsgroup) that there was an option - perhaps
undocumented - to dbaccess to tell it to stop upon receiving an error.
I can't find it in the Dbaccess User Manual but that don't mean it
ain't there.
Anyone familiar with this?
Thanks.
--
+----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+
|------------------- Bulletin Board Announcement ----------------------|
| Congregants will please note that the bowl at the back of the church |
| bearing the sign "For the Sick" is for monetary contributions only. |
+----------------------------------------------------------------------+
Sent via Deja.com http://www.deja.com/
Before you buy.
Set env.variable
DBACCNOIGN=1
It will help
Nebojsa
On Fri, 08 Sep 2000 20:15:48 GMT, Jacob Salomon <JSalomon@bn.com> wrote:
>Hi, Family.
>
>If I run dbaccess interactively - with the menus - I can choose a
>script file to run. If it encounters an error, the statement gets
>rolled back and the script stops executing right there. So if I have a
>10-statement script and it barfs on the 4th statement, only the first
>three will have been executed.
>
>By contrast, if I run dbaccess non-interactively:
> $ dbaccess yutz yada.sql>and it encounters an error, the process continues to execute the
>remaining SQL statements in the script. So in the above example, it
>will have executed statements 1-3, then 5-10, effectively skipping
>statement 4.
>
>I have a situation in which this is not acceptible.
>
>I recall (from this newsgroup) that there was an option - perhaps
>undocumented - to dbaccess to tell it to stop upon receiving an error.
>I can't find it in the Dbaccess User Manual but that don't mean it
>ain't there.
>
>Anyone familiar with this?
>
>Thanks.
WOW!
I got an avalnche of the same reply:
export DBACCNOIGN=1 # To stop after an error
I did not find this in the official documentation of dbaccess (I have
the manual for 7.23) so I presume it is an undocumented open secret.
Thanks to Rick, Paul, and Nebojsa.
I also see why I recalled it being asked recently: The issue was
covered this past July. (Maybe it belongs in the FAQ. Or is already
there..)
In article <8pbhct$hvr$1@nnrp1.deja.com> I, JSalomon@bn.com wrote:
--- SNIP ---
> I recall (from this newsgroup) that there was an option - perhaps
> undocumented - to dbaccess to tell it to stop upon receiving an error.
> I can't find it in the Dbaccess User Manual but that don't mean it
> ain't there.
--- SNIP ---
+----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+
|------------------- Bulletin Board Announcement ----------------------|
| Congregants will please note that the bowl at the back of the church |
| bearing the sign "For the Sick" is for monetary contributions only. |
+----------------------------------------------------------------------+
Sent via Deja.com http://www.deja.com/
Before you buy.