?
Solved

ORA 00933 - SQL command not properly ended

Posted on 2008-10-10
3
Medium Priority
?
1,024 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 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Suggested Courses

762 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