Jump to content
  • Advertisement
Sign in to follow this  
ju2wheels

SQL w/ oracle

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive got everything connecting and working correctly with my java app intereacting with my database, but i now have a weird syntax issue with my sql statement generated by my frontend application. Say I have the following tables: TABLE1 ======= 1Col1 1Col2 1Col3 TABLE2 ======= 2Col1 2Col2 2Col3 TABLE3 ======= 3Col1 3Col2 3Col3 TABLE4 ======= 4Col1 4Col2 4Col3 Now lets say I use the following select statement: SELECT 1Col1, ..., 4Col3 FROM DB.TABLE1, DB.TABLE2, DB.TABLE3, DB.TABLE4 WHERE 1Col1 <> 'someVal' AND ... OR 4Col3 <> 'someVal' *... = random columns in between Now I get the following error: java.sql.SQLException: ORA-00918: column ambiguously defined This doesnt happen when I select columns from 2 or less tables. Its when I get into selecting a large number of columns from different tables that it has issues. Are they supposed to be kept in a specific order or something?

Share this post


Link to post
Share on other sites
Advertisement
I haven't actually used oracle before, but are you sure you can select the columns of all of those tables without joining them? Are you doing 4 different queries by any chance?

Share this post


Link to post
Share on other sites
What happens when you making smaller queries?
Heck, why *do* you have such a massively huge query of crossproducts?!? Use the JOIN command!!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!