SQL Language (MOSC)

MOSC Banner

Can a parameter be passed to embedded sql that uses an EOF ?

I would like to pass a parameter to the following code that uses an EOF

sqlplus username/password "Sample Text" <<EOF

prompt &1

select '&1' from dual;

exit;

EOF


However it does not seem possible to directly pass the parameter. The only workaround I have is to separate the code out to a separate script rather than use EOF embedding ( however I actually need to use this EOF embedding ) eg this workaround works but as above I need an EOF method


sqlplus username/password @myscript "Sample Text"

myscript.sql

=========

prompt &1

select '&1' from dual;

exit;


Has anyone any ideas on how to pass a parameter directly into the EOF method ?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center