How about this:
#!/bin/ksh
GetMaxLog()
{
sqlplus -s <<SQLEOF
/ as sysdba
set pagesize 0
set heading off
set verify off
set feedback off
set echo off
set trimspool on
set linesize 132
select ltrim(to_char(max(sequence#)))
from v\$archived_log
where archived='YES';
SQLEOF
}
v_MaxLog=`GetMaxLog`
echo The max redo log file generated is: $v_MaxLog
exit
- "Suri, Deepak" <DSuri_at_oxhp.com> wrote:
> Is there a way that allows me to return an alphanumeric string from an
> SQL*Plus or PL/SQL block to its calling UNIX shell ?
>
> The one way I can think of is embeding the PL/SQL code within a Pro*C
> wrapper and using host variables to return the value.
>
> Any other suggestions ?
>
> thanx
> deepak
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Suri, Deepak
> INET: DSuri_at_oxhp.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
Received on Wed Sep 20 2000 - 13:30:44 CDT