473,888 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with executing procedure

ilikesuresh
47 New Member
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 6309
bykwzpz
13 New Member
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 Recognized Expert Contributor
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
1330
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 Procedure? A theoretical example of the stored procedure (sadly, I'm not allowed to post the actual code):
2
8465
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 with it. The problem is that we *Sometimes* get the ORA-24338 error when executing a query. This problem occurs random, sometimes twice a day, sometimes not at all. In the eventlog we get an exception like this one (stacktrace):
4
2643
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 '#tmpContact'. Any ideas why this happens? The temporary table #tmpContact is used in the procedure, but as I say, it all works fine from the analyser. Thanks,
3
1802
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. However when I run it, the exception tells me that the parameter doesnt exist for that SP. Obviously it's founmd the stored procedure, but I am absolutely certain that
2
4289
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 could think of to resolve the problem but nothing works. The stored proc is running in the DB2 Stored Procedures Address Space and both the client and the proc have DSNELI linked into their load modules. The client and proc are running in TSO via...
5
3668
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 INTO table1
6
1741
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
4931
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 project involves simple stored_procs searching/retrieving Legacy data. Key problem is that in the case of the 'Job' table, the 'Job Number' is an alphanumeric value. Here is the current stored procedure:
1
2984
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 recompiling/executing the code with 1.4.1 (deploying the newly compiled stored procedure code as well). This is the original exception that I got before I tried any code modifications: java.io.IOException: invalid offset/length at...
4
3595
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 order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In the corresponding input field (text box) the user enters a new category order which gets stored in the...
0
9957
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11173
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10434
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9593
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5810
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4635
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.