Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

joins and undescriptive errors

Posted on 2006-06-13
9
Medium Priority
?
387 Views
Last Modified: 2012-05-05
I'm annoyed at how generic the errors of Oracle are.

I'm fairly experienced on other SQLs, very inexperienced in Oracle...
This query looks find to me:

SELECT
  SUBSTR(d.name,1,9) AS customer_id,
  it.x_directory,
  it.x_prod_issue_num,
  i.row_id,
  i.src_row_id,
  i.x_line_type,
  i.x_text_data,
  i.x_text_grf_tel_id,
  i.x_text_seq_num,
  i.x_text_gn,
  it.x_item_id
FROM
  siebel.s_note_quote_it i
LEFT JOIN siebel.s_quote_item it ON  i.src_row_id = it.row_id
LEFT JOIN siebel.s_doc_quote d ON it.sd_id = d.row_id
WHERE
((i.LAST_UPD > '12-jun-2006' and i.LAST_UPD_BY = '1-69LRD') or (i.CREATED > '12-jun-2006' and i.CREATED_BY = '1-69LRD'))
GO

And yet I get a very undescriptive error:

 ORA-00933: SQL command not properly ended

Anyone have any ideas?
0
Comment
Question by:MoriPi
  • 5
  • 4
9 Comments
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16900336
what is that GO at the end?
0
 

Author Comment

by:MoriPi
ID: 16900441
Thats not it.
Quirk of Aqua Data Studio/Oracle combination.  Thou shalt have GO.

Brian
0
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16900622
then you are either not using a good tool or not being attentive enough :)
even plain SQLPlus would indicate something like:

ERROR at line X:
ORA-00933: SQL command not properly ended

Other tools ommit that line number but get you to the problematic line. try that sql in an SQLPlus session and see the result.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:MoriPi
ID: 16908009
True... However I left that line out to ensure brevity:
>[Error] Script lines: 1-19 -------------------------
 ORA-00933: SQL command not properly ended 

Which translates as "its somewhere between lines 1 and 19".  Which is _really_ helpful lol.

Brian
0
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16909205
have you tried that in an SQLPlus session? that doesn't seem to be an SQLPlus kind of message...
0
 

Author Comment

by:MoriPi
ID: 16909242
I'm pretty sure its something to do with the JOIN.. Only seems tohappen with the join.

Brian
0
 
LVL 1

Accepted Solution

by:
primusmagestri earned 200 total points
ID: 16909538
I tried to rectreate your situation - created tables with the same columns as yours. I did that just to make sure I have the exact same situation, because other than that GO at the end there seem to be no problem. Look what I got in SQLPlus:

ERROR at line 19:
ORA-00933: SQL command not properly ended

Now, there are a couple of things:
1.You are using a bad tool
2.You are stubborn and do not want to try your script in an SQLPlus session to see the real problem
3.For 50 points it's not worth trying to convince you, I don't even know why I continued after my first comment in here...
0
 

Author Comment

by:MoriPi
ID: 16909578
Sorry primusmage.. Only starting on Oracle...  I'm used to MSSQL and Sybase..  Actually don't know if I have SQLPlus installed; and I had a testing deadline today.
heh. sorry for your trouble.  and thanks for your attempt.  I have since found its because its Oracle 8 which aparently doen't support ANSI joins.. *shrugs*
But for your trouble you win.
0
 
LVL 1

Expert Comment

by:primusmagestri
ID: 16909608
oh, well, that's a problem, too... Indeed, ANSI joins are only supported starting 9i.
SQLPlus is a tool that comes with every server or client installation of Oracle, it's the most basic tool. In order to ease your struggle with Oracle, I would suggest trying PL/SQL Developer from Allround Automatitions, it's a great tool.

good luck!
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question