Re: Java.sql.SQlException
- From: Clive_ <cliveswan@xxxxxxxxxxx>
- Date: Fri, 02 Nov 2007 03:57:20 -0700
On 31 Oct, 12:40, Lew <l...@xxxxxxxxxxxxx> wrote:
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
Hi Lew,
Will try this.
Thanks for advice.
Cheers
Clive
.
- Next by Date: what if any are the recommended ways of accessing a database using jdbc from a c++ application?
- Next by thread: what if any are the recommended ways of accessing a database using jdbc from a c++ application?
- Index(es):
Relevant Pages
|
|