Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to pass variables from a korn script to an oracle stored procedure that sends email. However when I pass the subject or the body of the email to the sql script that calls the procedure, each word of the subject or the body are treated as a seperate parameter. I have tried to surround with double quotes, single quotes, brackets, etc...
Here is an example:
executing sql script:
nohup sqlplus -s $UID_PWD @run_mail.sql $sender $receiver $subject $body
where subject = Test email 1
and body = this is a test email
The sql script basically just calls the stored procedure like this ...execute run_mail('&1','&2','&3','&4')
When I run this the subject gets treated as 3 parameters instead of 1 bcause it contains 3 words. The body is treated as 5 paramters because there are 5 words.
Any idea how I can send a pramter consisting of multiple words and spaces to another script or Oracle process?
Any help would be appreciated!Thanks,
Joe

Joe:
I'm not an Oracle person, but sometimes the shell eats the double quotes. Have you tried something like:
nohup sqlplus -s $UID_PWD @run_mail.sql $sender ""$receiver $subject $body""
where the last 3 vars are treated as one argument.
Or perhaps you might have to escape the inner quotes:
nohup sqlplus -s $UID_PWD @run_mail.sql $sender "\"$receiver $subject $body\""Regards,
Nails

Thanks fro the input. Actually I figured out that using the escape \ works when setting up the variables. However there looks like there is a limit on the amount of characters you can pass as an argument. So passing a large message body to an email is not going to work.
It looks like I will be able to do it another way though. I am using mailx within unix. Gets a little complicated though when trying to attach files... I will post when I figure it out.
Joe

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |