Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Howto to fill a (define) variable in sqlplus with an "host" output

Status
Not open for further replies.

PTameris

Technical User
Jul 16, 2004
15
0
0
NL
Hi,

I want to fill an sqlplus variable with the output of an external command, but before the connect to a database...

So:

# sqlplus /nolog
sql >!echo $PPID
123456

and now i want to fill (with define?) an variable (let see ospid) with 123456

but how?

Greetings
Peter
 
Read it again: you should pass it as a parameter to sql from a shell.
So how about describing your final target? I mean that your task is too exotic to be good solution for anything I may imagine :)

Regards, Dima
 

Why not just use a generic account with no privileges (except CREATE SESSION) to generate the unique ID:

Code:
SQL>conn guest/guest
SQL>col s new_value sessid
SQL>Select DBMS_SESSION.UNIQUE_SESSION_ID from dual;
-- Now from here sessid is unique!
[noevil]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top