Emailing results of a pl sql procedure from UNIX shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Emailing results of a pl sql procedure from UNIX shell script
# 8  
Old 12-17-2015
I changed it to look like:


Code:
while IFS=',' read f1 f2 f3
do
if [ $f1 -eq $a]

now getting error :
Code:
test.sh[17]: test: A ] character is missing.
test.sh[21]: test: A ] character is missing.
test.sh[17]: test: A ] character is missing.
test.sh[21]: test: A ] character is missing.

Can someone please help me with a running code?

Moderator's Comments:
Mod Comment edit by bakunin: CODE-tags, please!

Last edited by bakunin; 12-18-2015 at 01:21 AM..
# 9  
Old 12-17-2015
Show us the contents of results.csv
# 10  
Old 12-18-2015
Moderator's Comments:
Mod Comment We have asked you several times now to use CODE-tags. This is not optional but a rule, hence the infraction. Continue to ignore this and your account will eventually be set to read-only or even be banned altogether.


On a personal note: i take only minimal pleasure in re-editiing your posts to put the missing CODE-tags in after you left them out.

Quote:
Originally Posted by Bunty bedi
I changed it to look like:


Code:
while IFS=',' read f1 f2 f3
do
if [ $f1 -eq $a]

now getting error :
The last "]" needs a space character in front, because it is a (required) parameter in its own right:

Code:
yours  : if [ $f1 -eq $a]
correct: if [ $f1 -eq $a ]

I hope this helps.

bakunin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recompile PL/SQL Procedure through UNIX

Hi, We have a procedure e.g. prc_synonym created in Oracle 12c Database. I want to do small change in procedure through Unix. I have that changed procedure (prc_synonym) in proc.sql file. Want to recompile that procedure through Unix so that changes should reflect in existing procedure in... (10 Replies)
Discussion started by: Aparna.N
10 Replies

2. Shell Programming and Scripting

Export SQL results to .TXT file for emailing

Hi everyone, I am new to unix and bash and in need of some help. I am writing a script that will execute a SQL query. The script runs and the SQl query runs, but I cannot figure out how to save the results as a file that can be emailed to a user. Here is my scripts thus far: #!/bin/sh SID=$1... (2 Replies)
Discussion started by: alpinescott
2 Replies

3. Shell Programming and Scripting

How to Pass the Output Values from the PL/SQL Procedure to Shell Script?

hi, Could anyone tell me how to pass the output values of the PL/SQL procedure to Shell script and how to store that values in a shell script variable... Thanks in advance... (5 Replies)
Discussion started by: funonnet
5 Replies

4. Shell Programming and Scripting

Passing a value to stored procedure from unix shell script

Hi Dudes :) I want a unix shell script to pass value to SQL stored procedure. Below is the procedure declare res varchar2(10); begin odm_load_check('PRE_SANITY',res); dbms_output.put_line(res); end; select * from error_log; truncate table error_log; select * from test; (1 Reply)
Discussion started by: shirdi
1 Replies

5. Shell Programming and Scripting

Invoking Oracle stored procedure in unix shell script

Here's a shell script snippet..... cd $ORACLE_HOME/bin Retval=`sqlplus -s <<eof $TPDB_USER/april@$TPD_DBCONN whenever SQLERROR exit 2 rollback whenever OSERROR exit 3 rollback set serveroutput on set pages 999 var status_desc char(200) var status_code... (1 Reply)
Discussion started by: hidnana
1 Replies

6. Shell Programming and Scripting

How to compile a stored procedure that is there with in a script file(.sql) in unix

Hi, How can i compile the procedure code that is there in a script file (.sql) in unix. (0 Replies)
Discussion started by: krishna_gnv
0 Replies

7. Shell Programming and Scripting

Calling an Oracle Stored Procedure from Unix shell script

hai, can anybody say how to call or to execute an oracle stored procedure in oracle from unix... thanks in advance.... for ur reply.... by, leo (2 Replies)
Discussion started by: Leojhose
2 Replies

8. UNIX for Dummies Questions & Answers

sql query results in unix shell script

Hi I want to get the a field from a SQL query into unix shell script variable. the whole situation is like this. 1. Opened a cursor to a table in DB2 databse. 2. Fetching individual rows with the help of cursor. 3. Each row has 4 fields. I want each of the field in individual shell... (1 Reply)
Discussion started by: skyineyes
1 Replies

9. UNIX for Dummies Questions & Answers

Running PL/SQL procedure via unix

All, I have a 10g PL/SQL procedure that needs to be run via a unix script. How could such a script be developed. Thanks Aditya. (1 Reply)
Discussion started by: kingofprussia
1 Replies

10. Shell Programming and Scripting

return variable from PL/SQL procedure to shell

Hi i'm calling a pl/sql procedure which is returning one variable. i'm trying to assing this value to variable in shell script the code i wrote is ** in shell script** var= 'sqlplus user/pass @ret.sql' echo $var ** and variable dum_var number exec rt_test(:DUM_VAR); exit; in... (4 Replies)
Discussion started by: ap_gore79
4 Replies
Login or Register to Ask a Question