Home » SQL & PL/SQL » SQL & PL/SQL » Error codes (oracle database edition)
Error codes [message #414099] Mon, 20 July 2009 06:54 Go to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
I am trying to query a table but keep getting different error codes

select Distinct Empno, Ename
from Employee
(where Dname = 'Web design'
from department;

Error code reads ....ORA-00933: SQL command not properly ended....
Re: Error codes [message #414100 is a reply to message #414099] Mon, 20 July 2009 06:56 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
missing parenthesis

In addition, please read and follow the guidelines that you have been show several times before.

[Updated on: Mon, 20 July 2009 06:58]

Report message to a moderator

Re: Error codes [message #414101 is a reply to message #414099] Mon, 20 July 2009 07:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This statement is meaningless please check SQL syntax in Database SQL Reference.

Also please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Re: Error codes [message #414104 is a reply to message #414101] Mon, 20 July 2009 07:01 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Michel Cadot wrote on Mon, 20 July 2009 13:00
This statement is meaningless please check SQL syntax in


Of course it is! Totally missed that! DOH! Sad
Re: Error codes [message #414112 is a reply to message #414099] Mon, 20 July 2009 07:11 Go to previous messageGo to next message
victor43
Messages: 18
Registered: July 2009
Junior Member
select Distinct Empno, Ename, dname
from Employee, department
where employee.empno = employee.ename
and employee.ename = employee.dptno
and employee.dptno = department.dptno
and department.dptno = department.dname
and department.dname = 'Web Design';

This time it reads ORA-01722: invalid number
Re: Error codes [message #414113 is a reply to message #414112] Mon, 20 July 2009 07:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
This time it reads ORA-01722: invalid number

Quote:
and department.dptno = department.dname

And the return code surprises you?

Regards
Michel
Re: Error codes [message #414122 is a reply to message #414113] Mon, 20 July 2009 07:45 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
Michel Cadot wrote on Mon, 20 July 2009 13:15
Quote:
This time it reads ORA-01722: invalid number

Quote:
and department.dptno = department.dname

And the return code surprises you?

Regards
Michel



Could be that line.
Or this one:
employee.empno = employee.ename


or this one:
employee.ename = employee.dptno


@victor43 - before you go any further work out what the relationship between your tables actually is.
Re: Error codes [message #414123 is a reply to message #414112] Mon, 20 July 2009 07:46 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
After you finish reading the chapters on SQL syntax, you might want to find a book on logic.
Previous Topic: Need a Query to update....below are requirements
Next Topic: Materialized view fast refresh is working slow compared to complete refresh
Goto Forum:
  


Current Time: Fri Feb 07 18:00:49 CST 2025