You can't use shell variables ($app_id) in your SQL file. It's an SQL file, not a shell script.
I would suggest that you either include the SQL directly inside the SQLPlus in your shell script, or you substitute the value in your SQL file before passing it (@) into SQLPlus.
I know htis isnt exactly unix.... but hopefully someone can help me or direct me someplace to get help.
I can run sql queries in scripts against my informix db using:
dbaccess mydb myquery.sql >> sql.output
I need to write my script to select based on todays date. Its very... (5 Replies)
Hi All,
I need to select one column from a table based upon the passed in parameter.
I tried this:
sqlplus -silent $MISP_USER << EOF
set feedback off;
set verify off;
set sqlprompt ""
SELECT mail_flag
FROM dailyjobs
WHERE job_name = '$1';
exit 0
EOF
exit... (1 Reply)
hi all,
i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code.
sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE
whenever sqlerror exit
set serveroutput on size 1000000
declare
l_rc ... (0 Replies)
Hi,
I have a unix varaible called as account which hold values which i want to use in a PL/SQL block in a shell script.
This variable value is being used in multiple places in the PL/SQL block and i get an erroe whenenevr is use this varaible with $prompt.
Help Urgently (1 Reply)
Hi All
I have a requirement where in I am stuck. There is a shell script that is being developed by me. It consist of the sql stmt also. I need to export a variable called HOMEPAGE with a value say www.abc.com. and then use this $HOMEPAGE variable in the sql stmt. My ultimate aim is to fetch all... (1 Reply)
Can i do this
Say one command
sed 's/:*/ /g' $summf
is returning
C1234
C2345
C3434
some no of rows, now this ouput i have to insert it into a DB table
how do i do this?? (2 Replies)
Hello,
I have a script to get the information from database, however, it's look like the loop is not work, can someone help? :confused:
echo Input file list to check:
read filelist
for file in 'cat $filelist.txt'
do
echo "select FILENAME from FILE_TABLE where filename like '${file}'%;" >>... (9 Replies)
Hi,
I have the following basic script. However, the statement (line 5) is not work. The output data is not able to set my request format a30. Any advise? :mad:
echo " Column filename format a30"|sqlplus4
echo Input file list to check:
read filelist
for file in `cat $filelist.txt`
do... (1 Reply)
I have a sql statement , i need to assign to a variable in Unix
sel count(*) AS num_files from TABLE_A;
i need to use "num_files" in unix statements. let me know how to assign unix variable to above num_files (1 Reply)
Greetings Experts,
I am on AIX using ksh. Created a unix script which generates the CREATE OR REPLACE VIEW ... and GRANT .. statements, which are placed in a single .txt file. Now I need to execute the contents in the file (there are around 300 view creation and grant statements) in Oracle and... (4 Replies)