By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,697 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,697 IT Pros & Developers. It's quick & easy.

regarding shell scripts and database function.

P: 14
hello,
i have a problem regarding following scenario,
------------------
#!/bin/sh
read $no

output=$(/usr/local/pgsql/bin/psql -d hrcurrency -t -c "select fn_deleteradno(no)")

echo $output

-----------------
My problem is how to pass the value read from the console to the function
fn_deleteradno(no)

if i straight away give the number by hard coring it in the function, it works fine.
May 12 '08 #1
Share this Question
Share on Google+
1 Reply

gpraghuram
Expert 100+
P: 1,275
hello,
i have a problem regarding following scenario,
------------------
#!/bin/sh
read $no

output=$(/usr/local/pgsql/bin/psql -d hrcurrency -t -c "select fn_deleteradno(no)")

echo $output

-----------------
My problem is how to pass the value read from the console to the function
fn_deleteradno(no)

if i straight away give the number by hard coring it in the function, it works fine.
output=$(/usr/local/pgsql/bin/psql -d hrcurrency -t -c "select fn_deleteradno($no)")

You have to use $var to get the value

raghuram
May 13 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.