i want to call a oracle function in my shell script

i want to call a oracle function in my shell script

run sqlplus

Can u please give me an example

depending on the exit status of the function i should create a control file. can someone help me with an example script

Can you give us some pseudo code (or cleaned up actual code) that we can look at to see what you want exactly?