RE: [JDBC] select on multiple tables

2001-08-21 Thread Peter Eisentraut
Dave Cramer writes: > Unfortunately id doesn't return A.c and B.c. Try it in psql... > > One way to solve this is to fix the backend to return fully qualified > column names. The backend is doing the right thing. In the most general case of a complex join you don't even know what table a column

RE: [JDBC] select on multiple tables

2001-08-20 Thread Dave Cramer
PM To: Carterette, Ben Cc: '[EMAIL PROTECTED]' Subject: Re: [JDBC] select on multiple tables On Mon, 20 Aug 2001 12:50:22 -0500, you wrote: >The SELECT is in a servlet, something like this: > >rs = stmt.executeQuery("SELECT * FROM " + >request.getParameter("table1

Re: [JDBC] select on multiple tables

2001-08-20 Thread Rene Pijlman
On Mon, 20 Aug 2001 12:50:22 -0500, you wrote: >The SELECT is in a servlet, something like this: > >rs = stmt.executeQuery("SELECT * FROM " + request.getParameter("table1") + >", " + request.getParameter("table2")); >session.setAttribute("result", rs); >request.sendRedirect(request.getParameter("p

RE: [JDBC] select on multiple tables

2001-08-20 Thread Carterette, Ben
7;t know anything and hopefully shouldn't care. I wanted to abstract it as much as possible. sorry for the confusion and thanks for the help. ben -Original Message- From: Rene Pijlman To: Ben Carterette Cc: [EMAIL PROTECTED] Sent: 8/20/01 12:28 PM Subject: Re: [JDBC] select o

Re: [JDBC] select on multiple tables

2001-08-20 Thread Rene Pijlman
On Thu, 16 Aug 2001 10:02:27 -0500, you wrote: >This won't work because I don't know in advance of the SELECT which >tables I'm going to be selecting from. I'm not sure if I understand this correctly. Whenever you write the SELECT statement you have to know the names of the tables, that's requ

Re: [JDBC] select on multiple tables

2001-08-20 Thread Ben Carterette
This won't work because I don't know in advance of the SELECT which tables I'm going to be selecting from. The SELECT is done in a servlet that determines the tables based on request parameters. I tried "SELECT table1.*, table2.* FROM table1, table2", but it still can't tell the difference b

Re: [JDBC] select on multiple tables

2001-08-15 Thread Rene Pijlman
On Wed, 15 Aug 2001 16:43:31 -0500, Ben Carterette wrote: >I have a query like "SELECT * FROM table1, table2" and I want to read values >out of a ResultSet. What if the two tables have column names in common and >I can't predict the column numbers? Is there any way to get table1.id and >table2.i

[JDBC] select on multiple tables

2001-08-15 Thread Carterette, Ben
I apologize in advance if this isn't the right place to ask this. I have a query like "SELECT * FROM table1, table2" and I want to read values out of a ResultSet. What if the two tables have column names in common and I can't predict the column numbers? Is there any way to get table1.id and tab