Re: Java.sql.SQlException



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


.



Relevant Pages

  • Re: HANDY FARM DEVICES
    ... >>That's because you didn't enclose the string in quotes. ... >>Try the same phrase in quotes and you'll find it returns 4 (Yes, ...
    (rec.woodworking)
  • Re: Type mismatch in ADO Recordset Open
    ... Enclosing the variable in quotes as I suggest won't sorce Access to search ... Dim strISBN As String ... Why would I enclose it in quotes? ...
    (microsoft.public.access.formscoding)
  • Re: Agent 3.0 Woof
    ... >> Sipowitz001@xxxxxxxxx appears to have caused the following letters to ... >>> If you enclose in quotes then at least do so with some accuracy. ... > Why should I, as a consumer, care about that? ...
    (rec.music.classical.recordings)
  • Re: Double Spaces in Group Name prevents export!!
    ... The filter clause should be enclosed in parenthesis, not quotes. ... should enclose the distinguished name of the group. ... Microsoft MVP Scripting and ADSI ...
    (microsoft.public.windows.server.active_directory)
  • Re: Paths including spaces
    ... BTW, what's wrong with my original suggestion to enclose the path in quotes? ...
    (microsoft.public.scripting.vbscript)