Re: Java.sql.SQlException



Clive_ wrote:
I do not want to create a inner or outer join. I want to make sure
that the UserID match in both tables. To ensure the user enters data
into the correct row.

In SQL, "Users.SurveyID" is not the same as "Users"."SurveyID". The latter means the "SurveyID" column of the "Users" table where case matters. Most RDBMSes prefer a case (lower for Postgres), and only enforce case when you enclose the identifier in quotes. However, you must enclose /each/ identifier separately in quotes, not the whole expression.

You didn't answer David's comment about using a table name in the query that was not part of your explanation:

I have two tables in SQl Server express - Users and Property1 both
with a
SurveyID column ie Users.SurveyID and Prop1.SurveyID
....
String querySQL=("Select * from Prop1_WallFinish where SurveyID =
\"Users.SurveyID\"" );

To go by just your description, you want something like:
SELECT * FROM Prop1 WHERE Prop1.SurveyID = ?
and use Users.SurveyID to fill the parameter.

--
Lew
.