Home » Infrastructure » Unix » missing select keyword on executing .sql from unix
missing select keyword on executing .sql from unix [message #409754] Tue, 23 June 2009 20:16 Go to next message
anya_03
Messages: 7
Registered: June 2009
Junior Member
Hi,
I am trying to execute a .sql from unix.the .sql scripts consists of a delete part and a merge part. The delete part works fine but the merge part gives me an error. When I execute the merge statement in the database using PL/SQL Developer, it works fine. But when I execute through sqlplus from unix, it throws this error:

SP2-0042:unknown command ")"src - rest of line ignored.
SP2-0042:unknown command "on" - rest of line ignored.
Error at line 1:
ORA-00928:missing SELECT keyword

I have attached my script here.
Pls advise. Why is it so that it is working fine in the database but not through unix.

Thanks.
  • Attachment: Merge.sql
    (Size: 4.04KB, Downloaded 1763 times)
Re: missing select keyword on executing .sql from unix [message #409767 is a reply to message #409754] Tue, 23 June 2009 23:21 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use SQL*Plus and copy and paste the execution of the script (adding "set echo on" at the beginning).
Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel

[Updated on: Tue, 23 June 2009 23:22]

Report message to a moderator

Re: missing select keyword on executing .sql from unix [message #409986 is a reply to message #409767] Wed, 24 June 2009 12:34 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
One syntax error to start with...
...
merge into tar
using
 ( select distinct set1.EXTRACT,
               set1.ACTION,
               set1.PLATFORM,
               set1.APPL,
               set1.BEN_ID,
               set1.EFF_DATE,
               set1.END_DATE,
               set1.MAJOR,
               set1.ASO,
               set1.FSA     <--- missing comma
               lkp1.SOLD,
               set1.CUST_ID,

...
Re: missing select keyword on executing .sql from unix [message #410012 is a reply to message #409986] Wed, 24 June 2009 17:55 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Good eye Andrew !

Amazing how the script works in PL/SQL Developer ??
Re: missing select keyword on executing .sql from unix [message #410016 is a reply to message #409754] Wed, 24 June 2009 19:47 Go to previous messageGo to next message
anya_03
Messages: 7
Registered: June 2009
Junior Member
Hi, I am really sorry about the missing comma, I had edited the column names and reduced their number (the actual script has around 50-60 columns) to include in the forum, so the missing comma is my mistake here while pasting, forgive me for that. The script is working absolutely fine in PL/SQL Developer because I am executing it manually these days to process my jobs. But in sqlplus, it is throwing me the "missing select keyword" error and I really am puzzled as to what could be causing this error?
Re: missing select keyword on executing .sql from unix [message #410019 is a reply to message #409754] Wed, 24 June 2009 20:04 Go to previous messageGo to next message
anya_03
Messages: 7
Registered: June 2009
Junior Member
Sorry for the inconvenience on account of my being a newbie. I hope I have taken care of all that you asked for now.
1.My Oracle version is 10g - 10.2.0.3.0
2.I got the exact same error while executing the merge statement from SQL*Plus after "set echo on".


SP2-0042 unknown command ") SRC"- rest of line ignored
SP2-0042 unknown command "ON"- rest of line ignored
error at line 1:
ORA-00928:missing Select keyword
Re: missing select keyword on executing .sql from unix [message #410040 is a reply to message #410019] Wed, 24 June 2009 23:07 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
2.I got the exact same error while executing the merge statement from SQL*Plus after "set echo on".

The purpose of this was for US to see it not to fix anything, so post your execution as I asked.

Regards
Michel
Previous Topic: Wipro Uwin - Unix Simulator - Anybody worked
Next Topic: Crontab entry on runtine
Goto Forum:
  


Current Time: Thu Mar 28 16:59:45 CDT 2024