Re: How to grab the output from SQLPlus or Svrmgrl

From: Joe Maloney <mpir_at_bellsouth.net>
Date: 26 Mar 2002 13:26:33 -0800
Message-ID: <d17bad25.0203261326.66c4abfe_at_posting.google.com>


You can use the exit to issue a return code from SQL*PLUS, but it would be 0 in this case (successful shutdown). I don't know how you would get the return code if Oracle isn't up.

Galen Boyer <galenboyer_at_hotpop.com> wrote in message news:<uvgbjuaej.fsf_at_rcn.com>...
> On Mon, 25 Mar 2002, harry_h_tang_at_yahoo.com wrote:
> > 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?
>
> The return code from svrmgrl and/or sqlplus will show successful
> execution. It won't return the error code of what you executed.
>
> The text should be able to be retrieved but not as a "returnVal = "
Received on Tue Mar 26 2002 - 22:26:33 CET

Original text of this message