An expression of non-boolean type specified in a context where a condition is expected, near ")".

An expression of non-boolean type specified in a context where a condition is expected, near ")".

am 20.08.2007 22:10:56 von pbd22

Hi,

I am trying to create an update statement
on a table with a foreign key to the Users
table (userid).

I am getting the error:

An expression of non-boolean type specified in a context where a
condition is expected, near ')'.

Below is the Update statement.

UPDATE LastLogin SET
date = '2007-08-14 05:34:09.910',
status = 1 ,
activity = 0
WHERE
(SELECT ll.status, ll.activity, ll.date
FROM LastLogin ll, Users u
WHERE ll.userid = u.userid
AND u.email = 'dushkin@hotmail.com')

Thanks!

Re: An expression of non-boolean type specified in a context where a condition is expected, near ")"

am 20.08.2007 22:47:35 von Roy Harvey

It looks like you are trying to use a correated subquery without the
correlation, and without either the IN or EXISTS that makes use of
such a subquery. Perhaps this will give you some ideas.

UPDATE LastLogin
SET date = '2007-08-14 05:34:09.910',
status = 1,
activity = 0
WHERE EXISTS
(SELECT *
FROM Users u
WHERE LastLogin.userid = u.userid
AND u.email = 'dushkin@hotmail.com')

Roy Harvey
Beacon Falls, CT

On Mon, 20 Aug 2007 13:10:56 -0700, pbd22 wrote:

>
>Hi,
>
>I am trying to create an update statement
>on a table with a foreign key to the Users
>table (userid).
>
>I am getting the error:
>
>An expression of non-boolean type specified in a context where a
>condition is expected, near ')'.
>
>Below is the Update statement.
>
>UPDATE LastLogin SET
> date = '2007-08-14 05:34:09.910',
> status = 1 ,
> activity = 0
>WHERE
>(SELECT ll.status, ll.activity, ll.date
> FROM LastLogin ll, Users u
> WHERE ll.userid = u.userid
> AND u.email = 'dushkin@hotmail.com')
>
>Thanks!

Re: An expression of non-boolean type specified in a context where a condition is expected, near ")"

am 22.08.2007 00:25:02 von pbd22

On Aug 20, 1:47 pm, Roy Harvey wrote:
> It looks like you are trying to use a correated subquery without the
> correlation, and without either the IN or EXISTS that makes use of
> such a subquery. Perhaps this will give you some ideas.
>
> UPDATE LastLogin
> SET date = '2007-08-14 05:34:09.910',
> status = 1,
> activity = 0
> WHERE EXISTS
> (SELECT *
> FROM Users u
> WHERE LastLogin.userid = u.userid
> AND u.email = 'dush...@hotmail.com')
>
> Roy Harvey
> Beacon Falls, CT
>
> On Mon, 20 Aug 2007 13:10:56 -0700, pbd22 wrote:
>
> >Hi,
>
> >I am trying to create an update statement
> >on a table with a foreign key to the Users
> >table (userid).
>
> >I am getting the error:
>
> >An expression of non-boolean type specified in a context where a
> >condition is expected, near ')'.
>
> >Below is the Update statement.
>
> >UPDATE LastLogin SET
> > date = '2007-08-14 05:34:09.910',
> > status = 1 ,
> > activity = 0
> >WHERE
> >(SELECT ll.status, ll.activity, ll.date
> > FROM LastLogin ll, Users u
> > WHERE ll.userid = u.userid
> > AND u.email = 'dush...@hotmail.com')
>
> >Thanks!

Thanks, that helped.
Nice to see somebody local.

Peter
New Haven, CT