Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to grab the output from SQLPlus or Svrmgrl

Re: How to grab the output from SQLPlus or Svrmgrl

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 25 Mar 2002 21:07:11 -0600
Message-ID: <uvgbjuaej.fsf@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 @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 = "

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.
Received on Mon Mar 25 2002 - 21:07:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US