![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling a shell script from php | eltinator | Shell Programming and Scripting | 1 | 04-22-2008 02:16 AM |
| Calling shell functions from another shell script | jisha | Shell Programming and Scripting | 6 | 04-05-2008 05:29 PM |
| Calling Shell Script | onlyroshni | Shell Programming and Scripting | 1 | 10-22-2007 08:29 PM |
| calling sql file from shell script | dummy_needhelp | Shell Programming and Scripting | 6 | 09-30-2007 11:55 PM |
| shell script calling problem | dhananjaysk | Shell Programming and Scripting | 2 | 03-30-2006 11:48 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Problem with Calling sql file from shell script
I have created abc.sh file which will set the environment variables (UNIX env variables as well as ORACLE required variables like ORACLE_SID,ORACLE_HOME etc) and then calls a function file which checks for starts some logs and then it will try to execute the .sql file. The .sh, function file are as follows
--ABC.SH #!bin/ksh . /rcs/ct/src/bin/initialize_ct_func # This is calling the initializing func file sql_run_ct_func_test /rcs/ct/scripts/test.sql #Calling the function file --FUNCTION FILE function sql_run_ct_func_test { v_function_name=sql_run_ct_func_test; start_ct_func "$@" if [ ! -a $1 ] then echo "!!! FAILED !!!" $1 "failed, exit status: 2" >> $v_shell_log exit 2 fi $SQLCMD << EOHD set term off set pages 0 set feedback off set heading off --set echo off set pause off set serverout on whenever sqlerror exit rollback spool $v_function_log @$1 exit sql.sqlcode EOHD if [[ $2 != [Nn] ]] ; then oracle_error_func ; fi v_function_name=sql_run_ct_func_test; end_ct_func } Now the problem is that the function file is being called and then exiting immediately without doing any thing. I tried checking whether Oracle env variables are set properly by adding "sqlplus uid/pwd" to the Environment variables setting file, which is working fine. But some how from function I am unable to execute the .sql file. Request you to suggest some ideas. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|