Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql spool file with '$' in name

Mike301Nov 13 2015 — edited Nov 15 2015

Friends,

DB: 11gR2

OS: Linux

I'm writing a shell script through which I pass schema name (OPS$USER) to the sql file to spool all objects of the user.

I'm not able to spool file with the '$' in the name, could somebody please suggest me if alternate options are available?

Since I'm using OPS$USER in the sql file as &1 I don't want to replace $ in the ksh script.

$SCHEMA = OPS$USER

$HOST = MAC

KSH:

$ORACLE_HOME/bin/sqlplus / @user_obj.sql $SCHEMA $HOST

SQL:

spool log.all_obj.&1.&2

SELECT count(*)

FROM dba_objects

WHERE username = &1;

exit;

Trying to create spool file with '$' sign in it or replace '$' with '_'.

i.e. log.all_obj.ops$user.mac or

log.all_obj.ops_user.mac

Many thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2015
Added on Nov 13 2015
2 comments
771 views