how can I call a pl/sql funciton in unix script

who can show me how to call pl/sql function or precudure in unix script..

cheers,

There are examples of how to do this in several of your previous threads.

i wanna

funciton A (p1 number)
{
return v2,
}

MM()
{
somehow call the function A and use the return value;

}

The following code snippet runs a SQL file that will execute a stored procedure. The three $DB_* variables are the Oracle ID, password, and server variables. I hope this helps.

sqlplus -s <<EOF > oracle_delete.log
$DB_id/$DB_pswd@$DB_server
start archive_delete.sql
EOF

Try this...

vValue=`sqlplus -s <<-EOF                                                                           
$DB_id/$DB_pswd@$DB_server
start archive_delete.sql
exit
EOF`

You're actually asking an Oracle question. If you have valid PL/SQL code please post it, and I'll help you.

Not very sure about the requirement but if you are planning to use a return value from a PL/SQL function, in a script you need to either spool the value in file or maybe use Oracles' text IO package (which basically amounts to the same thing). I would be grateful to have some helpful insights here too.