Re: How to grab the output from SQLPlus or Svrmgrl
Date: Tue, 26 Mar 2002 12:09:38 +0300
Message-ID: <3CA03AD2.8DB7B2F1_at_bill.mts.ru>
James Williams wrote:
>
> On Mon, 25 Mar 2002 19:49:52 GMT, "harry" <harry_h_tang_at_yahoo.com>
> wrote:
>
> In PROC- you can get the sqlerrm and the sqlcode out of the SQLCA.
>
> >I tried to write a utility in C++ which needs to take the output from
> >SQLPlus and/or Svrmgrl then present it to GUI. I write code such as:
> >
> >Assume: GMDBshutdown.sql is a shutdown scrip.
> >
> >char shutdownDBCmd[] = "svrmgrl _at_GMDBshutdown";
> >returnVal = system(shutdownDBCmd);
> >
> >/* the execution result can be something as:
> >"ORA-01034: ORACLE not available
> >ORA-27101: shared memory realm does not exist"
> >or
> >"Database closed.
> >Database dismounted.
> >ORACLE instance shut down."
> >
> >I want to get the error code and text returned but the above way does not
> >achieve the goal. Anyone knows how to get the returned text to the code?
Try do it using SQL*Plus' commands:
WHENEVER SQLERROR ...
EXIT SQL.SQLCODE
Valery Yourinsky
-- Oracle8 Certified DBA Moscow, RussiaReceived on Tue Mar 26 2002 - 10:09:38 CET