Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread How to use a subquery in an UPDATE statement?
Thu, Dec 14 2006 8:03 PMPermanent Link

Sam Jones
I am getting this error:

DBISAM Engine Error # 11949 SQL error - 'Right parentheses expected, instead found 'max'
in value expression'


When I run this query:

update Highest_Taste_Value
 set HighestKnownTaste = (select max(TasteValue) from FlavorList where TasteType=1 and
TasteCurrent=1)


How can I make this fly?

Thanks!
Thu, Dec 14 2006 8:04 PMPermanent Link

Sam Jones
Also: Running a recent (within five months) build of DBISAM v4
Thu, Dec 14 2006 10:11 PMPermanent Link

"Robert"

"Sam Jones" <sjones9@gmail.com> wrote in message
news:546CEB8F-00B8-410A-AC9E-54213F7A7AF2@news.elevatesoft.com...
>I am getting this error:
>
> DBISAM Engine Error # 11949 SQL error - 'Right parentheses expected,
> instead found 'max'
> in value expression'
>
>
> When I run this query:
>
> update Highest_Taste_Value
>  set HighestKnownTaste = (select max(TasteValue) from FlavorList where
> TasteType=1 and
> TasteCurrent=1)
>

Use a script

select max(TasteValue) MaxTaste into memory\temp from FlavorList where etc;
update Highest_Taste_Value
set HighestKnownTaste = Maxtaste
from Highest_Taste_Value, memory\temp;

Robert

Fri, Dec 15 2006 2:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sam,

<< When I run this query:

update Highest_Taste_Value
 set HighestKnownTaste = (select max(TasteValue) from FlavorList where
TasteType=1 and TasteCurrent=1) >>

You can't use sub-queries with anything other than IN in DBISAM.  Robert's
suggestion to use two statements in a script would be the proper workaround.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image