Solved

ORA 00933 - SQL command not properly ended

Posted on 2008-10-10
3
1,013 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
3 Comments
 
LVL 73

Expert Comment

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

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

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

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…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

705 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

15 Experts available now in Live!

Get 1:1 Help Now