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: svrmgrl question

Re: svrmgrl question

From: Kevin Brand <kevin.brandx_at_tel.gte.com>
Date: Fri, 2 Mar 2001 12:20:04 -0600
Message-ID: <97oodo$bth$1@news.gte.com>

using a shell wrapper ( unix or MKS Toolkit in windows ), construct the sql statement and feed it to svrmgrl via a HERE document.

:
#
# Shell script start
CONNECT=scott/tiger
TABLE_NAME=$1
SQLSTMT="select * from $TABLE_NAME"
TNS_SERVICE=""
#TNS_SERVICE="@tnsservice"

# Assuming your Oracle Environment is set: $ORACLE_HOME/bin/svrmgrl <<EOT

    connect ${CONNECT}${TNS_SERVICE};
    ${SQLSTMT};
EOT # Shell script end

If script name is "runit" and is executable, callit like this...

    runit <table_name>

That is minimal and you probably should start using SQL*PLUS, but it's a good starting point.

-Kevin

"Scott Weiner" <sweiner_at_infinata.com> wrote in message news:3A9FC85C.F868FAAA_at_infinata.com...
> I want to execute a sql script: Test.sql using svrmgrl.

>

> In the Test.sql there are some values that I would like ot have passed
> in as paramters.
>

> For instance:
> SELECT * FROM TABLE_NAME
>

> WHat syntax do I use to pass TABLE_NAME in as a call to svrmgrl?
>

> Note I am doing this as a batch process so it has to be a single command
> line.
>

> Thanks!

> Received on Fri Mar 02 2001 - 12:20:04 CST

Original text of this message

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