Sponsored Content
Top Forums Shell Programming and Scripting How to call an sql script inside a while statement in KSH Post 302411273 by bakunin on Thursday 8th of April 2010 05:56:36 AM
Old 04-08-2010
Quote:
Originally Posted by ryukishin_17
Code:
sh: Syntax error: '<<' is not matched.

Does anyone knows how to fix this error to be able to run the sql script successfully?
The problem is rather simple: you indented your code and indented the "here-document" too, but this is not allowed. When you write "process << EOF" the shell will search for a line starting with " EOF" and interpret everything between your statement and this line as part of the document.

As you have indented your source code you have changed this closing line of your here-document to several spaces and only then the "EOF" and this makes this line invalid. Example:

Code:
# will work:
some_process <<EOF
blah blah
EOF

# will not work:
some_process << EOF
blah blah
     EOF

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to call pl/sql in unix script

sample code as following: test_sql(){ #test#echo test_sql str=`$ORACLE_BIN/sqlplus -s $user/$passwd <<EOM set verify off set heading off set feedback off #--------start pl/sql { DECLARE CURSOR pah_cs IS select id from table where letter = 'abcd';... (6 Replies)
Discussion started by: YoYo
6 Replies

2. UNIX for Dummies Questions & Answers

how can a call shell script from pl/sql

I like to call a shell script from pl/sql proceduere and i have to use the shell script return value in that procedure. i am using oracle 9i and cygwin. can any one suggest me how can i do this (0 Replies)
Discussion started by: rajesh.P
0 Replies

3. Shell Programming and Scripting

how can i call a shell script from pl/sql

I would like to call the shell script from pl/sql and i need to uses the value returned by the shell script in pl/sql procedure. can any one suggest me how can i do that? (3 Replies)
Discussion started by: rajesh.P
3 Replies

4. Shell Programming and Scripting

Exit statement ignored inside KSH function

Hi All, I have multiple functions in my script and I'm trying to capture stdout from some of them, but I also do some error checking in them (in the functions that output something to their stdout that needs capturing) and I need to be able to end the entire script with an error message. ... (2 Replies)
Discussion started by: gkubok
2 Replies

5. Shell Programming and Scripting

how to pass a variable to an update sql statement inside a loop

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)
Discussion started by: ryukishin_17
0 Replies

6. UNIX for Advanced & Expert Users

call sql through shell script

Hi i am not able to connect sqlplus my script is as follows $ORACLE_HOME/bin/sqlplus << ! > /tmp/extract/DM.txt and output is SQL*Plus: Release 11.1.0.7.0 - Production on Wed Jan 18 02:53:54 2012 Copyright (c) 1982, 2008, Oracle. All rights reserved. Enter user-name: t175481... (1 Reply)
Discussion started by: tushar_spatil
1 Replies

7. UNIX for Dummies Questions & Answers

Call sql script

I want to call the sql query from UNIX..but how to set page size and other necessary parameters i don't know plz guide me how to do this (2 Replies)
Discussion started by: sagar_1986
2 Replies

8. Shell Programming and Scripting

issues with sql inside if statement

Hi, I have problem with the following code. My IF block is not executed. And I see "syntax error near unexpected token `)'" error for line "EOF" in the stats_function(). but when I comment the IF block I don't see this error. Kindly help me with this issue. clean_function() {... (10 Replies)
Discussion started by: babom
10 Replies

9. UNIX for Advanced & Expert Users

Using PHP , call a sql inside a unix script

I am running the xampp on WINDOWS, and my php script is connecting to a unix script on a different server (ssh2_connect("11.31.138.56", 22). I am running the unix script and inside this script I am calling the .sql file . The SQL is connecting to oracle db on the unix server. But the sqlplus... (2 Replies)
Discussion started by: madfox
2 Replies

10. UNIX for Dummies Questions & Answers

Call a UNIX script inside another and dont wait for it

Hi I have two scripts script1.sh and script2.sh(say this script is a long running). I want to call script2.sh inside and script1.sh,but when i call script2.sh i dont want to wait for script2 to complete and want this to run in back ground and go on next commands in script 1.sh and finally at the... (2 Replies)
Discussion started by: lijjumathew
2 Replies
MooseX::Declare::Syntax::Keyword::Role(3pm)		User Contributed Perl Documentation	       MooseX::Declare::Syntax::Keyword::Role(3pm)

NAME
MooseX::Declare::Syntax::Keyword::Role - Role declarations METHODS
generate_export CodeRef Object->generate_export () Returns a closure with a call to "make_anon_metaclass". CONSUMES
o MooseX::Declare::Syntax::MooseSetup o MooseX::Declare::Syntax::RoleApplication MODIFIED METHODS
imported_moose_symbols List Object->imported_moose_symbols () Extends the existing "imported_moose_symbols" in MooseX::Declare::Syntax::MooseSetup with "requires", "extends", "has", "inner" and "super". import_symbols_from Str Object->import_symbols_from () Will return Moose::Role instead of the default Moose. make_anon_metaclass Object Object->make_anon_metaclass () This will return an anonymous instance of Moose::Meta::Role. SEE ALSO
o MooseX::Declare o MooseX::Declare::Syntax::Keyword::Class o MooseX::Declare::Syntax::RoleApplication o MooseX::Declare::Syntax::MooseSetup AUTHOR
Florian Ragwitz <rafl@debian.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Florian Ragwitz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2013-12-14 MooseX::Declare::Syntax::Keyword::Role(3pm)
All times are GMT -4. The time now is 05:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy