Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORA-00907: missing right parenthesis error when div in SQL

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
0
0
US
My application uses a SQL query that does a division operation in the SELECT statement like this:

SELECT length / 0.3048 as length_eng,
width / 0.3048 as width_eng,
......

This SQL works fine if Oracle 9i driver is used to connect to the database, but when Oracle 10g driver (10.02.00.01) is used, it gives me "ORA-00907: missing right parenthesis" error. Do you know if this is a known issue with Oracle 10g driver? If so, is there a patch?

Thank you in advance for your help!
 
SJH,

There is more to this problem than your description implies, because using my 10.2.0.1 database, I have no problem with the code and its data:
Code:
SQL> @instance

Instance Host                      Oracle       Startup
Name     Name                      Version      Time/Date
-------- ------------------------- ------------ --------------------------
FOS102   foster                    10.2.0.1.0   02:07:07 on Fri, 14-APR-06
SQL> select * from sjh;

    LENGTH      WIDTH
---------- ----------
         1          1
         2          2
SQL> SELECT length / 0.3048 as length_eng,
  2           width / 0.3048 as width_eng
  3  from sjh
  4  /

LENGTH_ENG  WIDTH_ENG
---------- ----------
 3.2808399  3.2808399
6.56167979 6.56167979
Let us know how my test differs from your situation.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
This could be a reserved word issue. Suggest you change the name of your column from length to something like lngth or len etc ...
 
I, too, worried about your using "LENGTH" (function name) as a column name, but clearly, it works. (See my proof-of-concept example, above.)

So, SJH, I recommend your posting your full SQL statement that throws the error so that we can help you troubleshoot the problem (if you have not already resolve the problem and you're just holding out on us <grin>).

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top