Subject About doc...
Author Yusuf Celik
Hi,
I see the FDB doc in http://www.firebirdsql.org/index.php?op=doc site.
There are some in other languages some just in english.
I wonder if there are some volunteers doing the translation.
I might be missing the e-mail address about who to e-mail about doing a
translation?

With kindest regards
Yusuf CELIK

________________________________

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Milan Babuskov
Sent: Monday, August 20, 2007 1:44 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: update from select



--- Nick Upson wrote:
> I got "update table1 set field1 = (select field2 from table2 where
> ...)" but I have about 12 fields involved.
>
> Could someone more awake please post an example

You could do what sasha wrote, although it is not very good
performance-wise. If you have a lot of records, writing a stored
procedure (or EXECUTE BLOCK with Firebird 2) should be better:

EXECUTE BLOCK
AS
DECLARE VARIABLE c1...
DECLARE VARIABLE c2...
DECLARE VARIABLE c3... etc. for each column
BEGIN
for select c1, c2, c3, ...
from table1
into :c1, :c2, :c3...
do update table2 set c1 = :c1, c2 = :c2, ... where pk = :pk;
END

If you use Firebird 1.x or don't want to waste time writing such
procedures, you can use FBExport to do the job for you, by using -If
option. Example:

fbexport -Q "select field1, field2, ... from table1"
fbexport -If "update table2 set field1 = :1, field2 = :2 ... where..."

--
Milan Babuskov
http://fbexport.sourceforge.net <http://fbexport.sourceforge.net>






[Non-text portions of this message have been removed]