Solved

joins and undescriptive errors

Posted on 2006-06-13
9
369 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
Comment Utility
what is that GO at the end?
0
 

Author Comment

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

Brian
0
 
LVL 1

Expert Comment

by:primusmagestri
Comment Utility
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
 

Author Comment

by:MoriPi
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Expert Comment

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

Author Comment

by:MoriPi
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sql to get orphans 7 50
Oracle RMAN Database Restore 5 28
Oracle SQL Select within a Where Clause 9 37
sql query 9 18
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now