Dear Amit,

> "update lotjobtemp set duedate =  (select duedate from
> importparameters);"

In MySQL, you need 2 queries for this:

SELECT @var:=duedate FROM importparameters;
UPDATE lotjobtemp SET duedate = @var;

Most probably, you will want to use a WHERE clause for both statments.

To make this transaction safe, you can use InnoDB tables. Issue BEGIN
before the SELECT statement and COMMIT after the UPDATE statement.

HTH!
--
  Stefan Hinz <[EMAIL PROTECTED]>
  Geschäftsführer / CEO iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3


----- Original Message -----
From: "Amit Lonkar" <[EMAIL PROTECTED]>
To: "mysql" <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 1:34 PM
Subject: Update Query problem


> Hi All!!
>
> I am writing a .sql file. I want to execute this file
> at runtime.
>
> One of the queries is :-
> "update lotjobtemp set duedate =  (select duedate from
> importparameters);"
>
> This query generates an error as
> "ERROR 1064: You have an error in your SQL syntax near
> 'select duedate from impor
> tparameters' at line 1".
>
> I guess this is because subselects fail in mysql. Can
> any one tell me how to overcome this problem.
>
> Regards
> Amit Lonkar
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to