473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

problem with executing procedure

ilikesuresh
Hi all,
I have written athe following program to execute a procedure number of times using korn shell scripting
Expand|Select|Wrap|Line Numbers
  1. for number in `cat $INPUT_FILE`
  2. do
  3.    $SQLPLUS -S $sql_user_name/$sql_user_pwd@$sql_service <<EOF 1>>$LOG_FILE 2>>$LOG_FILE
  4.     set head off;
  5.     set echo off;
  6.     set serveroutput on;
  7.     exec number_names(&1);
  8.     $number
  9.     EOF
  10. done
  11.  
  12.  
But if i execute the program the error i got is
syntax error at line 22 : `<<' unmatched
But when i executing the same program with one number(not including in the for loop) the program executed fine.
In the log file i am getting,

PL/SQL procedure successfully completed.

SP2-0042: unknown command "EOF" - rest of line ignored.
SP2-0042: unknown command "done" - rest of line ignored.


Please help me out from this issue.

Thanks in advance
Jan 17 '08 #1
2 6264
bykwzpz
13
Hi all,
I have written athe following program to execute a procedure number of times using korn shell scripting
Expand|Select|Wrap|Line Numbers
  1. for number in `cat $INPUT_FILE`
  2. do
  3.    $SQLPLUS -S $sql_user_name/$sql_user_pwd@$sql_service <<EOF 1>>$LOG_FILE 2>>$LOG_FILE
  4.     set head off;
  5.     set echo off;
  6.     set serveroutput on;
  7.     exec number_names(&1);
  8.     $number
  9.     EOF
  10. done
  11.  
  12.  
But if i execute the program the error i got is
syntax error at line 22 : `<<' unmatched
But when i executing the same program with one number(not including in the for loop) the program executed fine.
In the log file i am getting,

PL/SQL procedure successfully completed.

SP2-0042: unknown command "EOF" - rest of line ignored.
SP2-0042: unknown command "done" - rest of line ignored.


Please help me out from this issue.

Thanks in advance
Hi,

You might try revising your SQL code line to this:
$SQLPLUS -S $sql_user_name/$sql_user_pwd@$sql_service1>>$LOG_FILE 2>&1 <<EOF

In this line, you are instructing the system to send standard out and standard error to the same place as before, but the real source of your problem was the <<EOF had to be the last thing on the line. You're creating what is sometimes called a 'here document.' The <<EOF says to start taking instructions until the EOF character string appears again. By having output redirection within the commands, you created the error.

Hope this helps. I just joined in so that's why the delay in answering.
Jan 28 '08 #2
ghostdog74
511 Expert 256MB
you might want to bring your EOF to start on the beginning of line
Expand|Select|Wrap|Line Numbers
  1. for blah .......
  2. do
  3.     sqlplus blah.... << EOF
  4.  
  5. EOF # put it at start of line
  6. done
  7.  
Jan 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: M Wells | last post by:
Hi All, I don't know if this is a truly esoteric question, or not, but I'm wondering how (or even if) you handle a timeout on a transaction within a stored procedure executed in a Stored...
2
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
4
by: Not Me | last post by:
Hi, I have a stored procedure, that works perfectly when run from the query analyser, however if I run it through access vba, (using exec) I get a runtime error 208: invalid object name...
3
by: Simon Harvey | last post by:
Hi everyone, I'm having a very frustrating problem executing a stored procedure. I'll put the code at the bottom. When I build the SP and add all the parameters everything goes as expected....
2
by: Rhino | last post by:
I am getting an sqlcode of -927 when I execute SQL within a COBOL stored procedure in DB2 OS/390 Version 6 on OS/390. I have looked at the error message for that condition and tried everything I...
5
by: Timppa | last post by:
Hi, Could anyone help me with my problem ? Environment: Access 2000 and Sql Server 2000. I have a stored procedure as follows: DROP table1 SELECT alias1.field1,alias2.field2,table2.field6...
6
by: Not4u | last post by:
Hello Config : SQL 2000 on WIN 2000 (IIS 5.0) In my ASP page for some queries i have this error : Microsoft OLE DB Provider for SQL Server error '80040e31' Timeout expired
4
by: red vertigo | last post by:
HI All, Can't quite get my head aorund this problem. My knowledge or more importantly my experience of using T-SQL is small and as a consequence my stored procedures are basic. My current...
1
by: amgupta8 | last post by:
Note: This problem occurred when I updated the JDK from 1.3.1 to 1.4.1 or 1.4.2. Nothing else was changed in the code, other than updating the JDK on the database server (dbm cfg parm jdk_path) and...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.