Solved

ORA 00933 - SQL command not properly ended

Posted on 2008-10-10
3
1,022 Views
Last Modified: 2013-12-19
Both of the following SQL statements give me the ORA 00933 error.

SELECT DISTINCT s.customer_name FROM depositor AS s WHERE NOT EXISTS ( (SELECT branch_name FROM branch WHERE branch_city = 'Brooklyn') EXCEPT (SELECT r.branch_name FROM depositor AS t, account AS r WHERE t.account_number = r.account_number AND s.customer_name = t.customer_name) );

SELECT t.customer_name FROM depositor AS t WHERE UNIQUE (SELECT r.customer_name FROM account, depositor AS r WHERE t.customer_name = r.customer_name AND r.account_number = account.account_number AND account.branch_name = 'Perryridge');

Any idea what is wrong with these query statements?  Yes, this is part of a homework assignment.  I am working on a graduate level database course and these two query statements have had me stumped for the last hour.  I am not asking anyone to do my homework, but any suggestions or guideance would be greatly appreciated.
0
Comment
Question by:doug5516
[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
3 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 22691828
The EXCEPT and WHERE UNIQUE clauses are not Oracle syntax
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22694953
EXCEPT is available in MS SQL Server.

the WHERE UNIQUE is unkown to me...

there are other modification operators for subqueries:
ANY  SOME   ALL
http://msdn.microsoft.com/en-us/library/ms187074.aspx
0
 
LVL 17

Expert Comment

by:sweetfa2
ID: 22708140
Depends how you are running them.  Some tools will fail if you are using the incorrect scripting engine.  For example if you are using toad you could select a single statement and run the single statement without issue.

Otherwise, you could select a run as script option in which case you shouldn't have an issue.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

691 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