Column not allowed, when I am writing sql in UNIX | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Column not allowed, when I am writing sql in UNIX

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-06-2013
mirwasim mirwasim is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 8 October 2013, 5:16 AM EDT
Posts: 105
Thanks: 8
Thanked 1 Time in 1 Post
Column not allowed, when I am writing sql in UNIX

Please advice to rectify below error


Code:
#!/bin/ksh
X=$(sqlplus -s user/pass << EOSQL
set serveroutput on;
set heading off feedback off serveroutput on trimout on pagesize 0
INSERT INTO TEST(df)
VALUES('a');
COMMIT;
EXIT;
EOSQL)
echo $X
echo $?
ERROR at line 2: ORA-00984: column not allowed here

Sponsored Links
    #2  
Old 07-06-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 23 September 2014, 5:37 PM EDT
Location: Galactic Empire
Posts: 3,385
Thanks: 234
Thanked 1,208 Times in 1,134 Posts
Looks like that command substitution is causing problem, try replacing it with backticks:

Code:
X=`sqlplus -s user/pass << EOSQL
set serveroutput on;
set heading off feedback off serveroutput on trimout on pagesize 0
INSERT INTO TEST (df)
VALUES ('a');
COMMIT;
EXIT;
EOSQL`

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
writing the output of SQL into one file 46019 Shell Programming and Scripting 4 09-30-2009 02:51 PM
Extracting column names from a table.. SQL with UNIX fmina UNIX for Dummies Questions & Answers 4 08-19-2008 01:52 AM
Writing to a File using pl/sql stky13 Programming 1 02-22-2008 07:45 AM
flags to suppress column output, # of rows selected in db2 sql in UNIX jerardfjay Shell Programming and Scripting 1 11-02-2005 05:48 AM
conditional writing of sql code kburrows Shell Programming and Scripting 0 09-21-2004 03:09 PM



All times are GMT -4. The time now is 08:25 PM.