Subject Re: [firebird-support] Re: Updating with inner join - noobie help needed
Author Lin XG
Hi Svien;

Your comments went a long way toward making my query
work properly.

Apologies to Alan for missing his name.

I played around with his query for about an hour and
just couldn't get it to work.

The only problem I had with your query was the
multiple appearnces of SET. It should be

UPDATE VT_TR_TABLE SET
VT_TR_TABLE.DISTRI = (SELECT.....
VT_TR_TABLE.DISTRI_PR = (SELECT.....);

I would like to use this as a stored procedure but
it's being called from a Visual Basic program which
has a whole lot of unresolved issues at the moment.

If anyone reading would care to comment, I would still
like to know why the original query doesn't work.

UPDATE Table_A SET
Table_A.A = Table_B.A,
Table_A.B = Table_B.B
Table_A.C = Table_B.C FROM Table_A INNER JOIN ON
Table_A.MASTER_KEY = Table_B.MASTER_KEY;

I've used this type of query lots with MS Access and
it works fine on Access tables and on linked Firebird
tables.

Thanks again for all the help, it's greatly
appreciated.

Lin



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com