Solved

joins and undescriptive errors

Posted on 2006-06-13
9
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 50 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

752 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