Sponsored Content
Top Forums Shell Programming and Scripting Sqlplus not connecting the 2nd time in for loop Post 303006697 by ajayakunuri on Monday 6th of November 2017 01:14:17 PM
Old 11-06-2017
Thanks Jim for your reply. print is not working and so I changed it to printf, but it is not printing it out correctly:

Below is the statement that I see in tmp.sql:
Code:
SELECT pi.memberid,pi.poolid,m.mediagtype from poolsitems pi inner join mediagroups m on
m.mediagroupid=pi.memberid where pi.poolid='285071285071 and pi.RELEASENUMBER='2017.x.17_MWR'
and m.mediagtype='17' and m.startdate <= sysdate and m.enddate >= sysdate;SELECT pi.memberid,pi.poolid,m.mediagtype from poolsitems pi inner join mediagroups m on
m.mediagroupid=pi.memberid where pi.poolid=2017.x.17_MWR285071' and pi.RELEASENUMBER=2017.x.17_MWR
and m.mediagtype='17' and m.startdate <= sysdate and m.enddate >= sysdate;

When using print(nothing is going to tmp.sql since print doesnt work):
Code:
+ print 'SELECT pi.memberid,pi.poolid,m.mediagtype from poolsitems pi inner join mediagroups m on
m.mediagroupid=pi.memberid where pi.poolid=%s219808%s and pi.RELEASENUMBER=%s2017.x.07_MWR%s
and m.mediagtype='\''17'\'' and m.startdate <= sysdate and m.enddate >= sysdate;' ''\''' 219808 ''\''' ''\''' 2017.x.07_MWR ''\'''
./prod_Astra_pool_alert_2.sh: line 43: print: command not found

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

error connecting to sqlplus

Hi, I wrote a shell script to call oracle procedure. But when i am trying to connet sqlplus with the fallowing statement It is giving me error " callproce.sh : sqlplus: not found". What could be the problem. sqlplus -s $CONNECT_STRING >$LOGFILE <<!! thank u all papachi (2 Replies)
Discussion started by: papachi
2 Replies

2. Shell Programming and Scripting

calling sqlplus from within a for loop

i'm not new to programming, but i AM new to unix scripting. here's my deal. this works: #!/bin/ksh echo "HELLO" /oracle_home/bin/sqlplus username/password@MYDB<<EOF SELECT COUNT(*) FROM EMPLOYEES; EOF exit echo "GOODBYE" this doesn't: #!/bin/ksh echo "HELLO" for x in 1 2... (4 Replies)
Discussion started by: akosz
4 Replies

3. Shell Programming and Scripting

Showing errors when connecting to sqlplus in shell script

hi, I am trying to automate the compilation of procedures stored in .sql files in Unix. Is there any way in which we can sho err if there errors are raised in the compilation? I am using the following code to connect to the sqlplus sqlplus ${SQL_USER}/${SQL_PASSWORD} (5 Replies)
Discussion started by: silas.john
5 Replies

4. Shell Programming and Scripting

connecting through sqlplus

I am trying to connect to one of the oracle sever using uni through sqlplus command: sqlplus -s BOXI_ALPH_AUDITOR,Q078_audit$@Q047 But its not getting connected. I tried using some different server using same syntax its working. What differene i found is the password is having no special... (2 Replies)
Discussion started by: gander_ss
2 Replies

5. UNIX for Dummies Questions & Answers

Connecting to Oracle DB using sqlplus

Hi, I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following: 1. Connect to oracle database hosted on a different server 2. fire a query on the oracle db 3. store the output in a variable 4. use this variable for further logic... (1 Reply)
Discussion started by: shrutihardas
1 Replies

6. Shell Programming and Scripting

Connecting to Oracle DB using sqlplus

Hi, I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following: 1. Connect to oracle database hosted on a different server 2. fire a query on the oracle db 3. store the output in a variable 4. use this variable for further logic... (26 Replies)
Discussion started by: shrutihardas
26 Replies

7. UNIX for Advanced & Expert Users

Connecting once using sqlplus and doing multiple queries

Hello everyone, It's my first week using unix and shell scripting. I tried creating a script that has a function that execute SQL query. my script looks something like this: ---------------------------------------------------- #!/bin/sh tableName="myTable" secondTable="secondTable"... (2 Replies)
Discussion started by: edlin_r
2 Replies

8. Shell Programming and Scripting

IF loop in sqlplus

Hi all, I am trying to use if loop inside SQLPLUS....is it possible...bcoz i tried a whole day with all the possibilities....no use...pls help Here's the code: KRITI = $? sqlplus -s /NOLOG << EOF connect $USER/$PASS IF $KRITI = 0 THEN create table kriti_employees( emp_id ... (1 Reply)
Discussion started by: kritibalu
1 Replies

9. Red Hat

TNS Timeout Error when connecting to SQLPLUS through scripts only

Hi, I am facing a strange issue when connecting to SQLPLUS via a shell scripts. I am using Linux 2.6.18-274.18.1 and gbash shell. When I connect to SQLPLUS through scripts then it throws TNS Time Out error ""sometimes"" and connects successfully other times.This is only happening when... (9 Replies)
Discussion started by: aashish.sharma8
9 Replies

10. Shell Programming and Scripting

Connecting sqlplus from UNIX with multiple select statement

hi, i have a requirement where i need to connect sqlplus from unix and i am able to do so by following command: cust_count=`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID << EOF set pagesize 0 set feedback off set verify off ... (1 Reply)
Discussion started by: lovelysethii
1 Replies
set_color(1)                                                           fish                                                           set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 08:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy