Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 20th, 2005, 11:04 PM   #1
TeamElement1
Newbie
 
TeamElement1's Avatar
 
Join Date: Oct 2005
Posts: 8
Rep Power: 0 TeamElement1 is on a distinguished road
SQL Help

Say I have two tables, one being a table of events, and one a table of restritcions. They are related because events have restrictions. Now I want to join the tables so that it lists all the events with corresponding restrictions. Things to note, the event table and restriction tables have already been populated. If you think it'd be easier to talk over AIM my name is TeamElement3, I can show you my ER Diagram or anything else needed to help answer the question.

Thanks in Advance
John
TeamElement1 is offline   Reply With Quote
Old Oct 21st, 2005, 9:25 AM   #2
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
If you can simply describe both tables, we can get you some help.
jim mcnamara is offline   Reply With Quote
Old Oct 21st, 2005, 5:02 PM   #3
TeamElement1
Newbie
 
TeamElement1's Avatar
 
Join Date: Oct 2005
Posts: 8
Rep Power: 0 TeamElement1 is on a distinguished road
Event:
EID int
Time varchar( 16 )
Name varchar( 40 )

Restriction:
Name varchar ( 20 )
Make varchar( 10)
Type varchar( 10)
beginyear int
end year int

first in each is the primary and foreign key
TeamElement1 is offline   Reply With Quote
Old Oct 21st, 2005, 5:21 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
What exists that's common to both tables? Name? (They have different descriptions.) In other words, what relates an event and a restriction or set of restrictions?

Generally, the reason things like this are conducted in the forum, and not over AIM, is that it makes a wider spread opportunity for you, us, and the other members to learn. It's one reason forums exist.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 21st, 2005, 6:25 PM   #5
TeamElement1
Newbie
 
TeamElement1's Avatar
 
Join Date: Oct 2005
Posts: 8
Rep Power: 0 TeamElement1 is on a distinguished road
I was being foolish previously, I've solved that problem, but ran into a new one!
java.sql.SQLException: ORA-00955: name is already used by an existing object
What does this exactly mean?

stack trace below:

java.sql.SQLException: ORA-00955: name is already used by an existing object

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
at has_res.createTables(has_res.java:37)
at has_res.main(has_res.java:112)
TeamElement1 is offline   Reply With Quote
Old Oct 21st, 2005, 6:38 PM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You are attempting to create a table or index that already exists. There are other objects, but I'd guess it's one of those.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 21st, 2005, 6:41 PM   #7
TeamElement1
Newbie
 
TeamElement1's Avatar
 
Join Date: Oct 2005
Posts: 8
Rep Power: 0 TeamElement1 is on a distinguished road
index as in column name?
TeamElement1 is offline   Reply With Quote
Old Oct 21st, 2005, 6:47 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You're writing database code without knowing what an index is?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC