Home » Infrastructure » Unix » how to escape $ in the package name called from shell script (Oracle 9.2.0.6.0 on HP_UX)
how to escape $ in the package name called from shell script [message #461987] Tue, 22 June 2010 05:31 Go to next message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Hi,

Please refer snippet of my code

val=`sqlplus -s $db_user/$db_passwd<<EOF
set feedback off heading off
var x varchar2(100)
var y varchar2(100)
var z varchar2(100)
exec myco$extract0600.file_batch_proc"('$v',:x,:y,:z);


Here I am unable to escape the $ in the package name 'myco$extract0600'

I tried escaping it by '\' "" but no luck

following is what i tried so far

myco\$extract0600.file_batch_proc"('$v',:x,:y,:z);
"myco$extract0600.file_batch_proc"('$v',:x,:y,:z);


Could you please suggest any option

Thanks and Regards,
Chetana
Re: how to escape $ in the package name called from shell script [message #461998 is a reply to message #461987] Tue, 22 June 2010 05:55 Go to previous messageGo to next message
Michel Cadot
Messages: 58960
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is the purpose of " in
myco$extract0600.file_batch_proc"('$v',:x,:y,:z);

Just remove it and escape $ with \ so:
myco\$extract0600.file_batch_proc('$v',:x,:y,:z);


Regards
Michel
Re: how to escape $ in the package name called from shell script [message #461999 is a reply to message #461987] Tue, 22 June 2010 05:59 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10621
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
exec some\$procedure;

Re: how to escape $ in the package name called from shell script [message #462002 is a reply to message #461987] Tue, 22 June 2010 06:05 Go to previous messageGo to next message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Many Thanks Michel for your quick reply

The " left out while I was trying to anonymise the content

In fact I was trying
[code
"myco$extract0600.file_batch_proc('$v',Mad,:y,:z)";
myco\$extract0600.file_batch_proc('$v',Mad,:y,:z);
][/code]
But it did not work

Just now I tried(arbitrarily) following and it worked (2 \\)
myco\\$extract0600.file_batch_proc('$v',:x,:y,:z);


Many Thanks for your quick reply

Thnaks and Regards,
Chetana
Re: how to escape $ in the package name called from shell script [message #462003 is a reply to message #461999] Tue, 22 June 2010 06:07 Go to previous message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Mahesh, Thanks to you as well

It just resolved with 2 \\

Regards,
Chetana
Previous Topic: Not able to use sqlldr
Next Topic: Pls provide the pdf format of UNIX complete Reference Book
Goto Forum:
  


Current Time: Wed Sep 03 04:00:51 CDT 2014

Total time taken to generate the page: 1.52887 seconds