I have two tables, a master customer table and a customer update table, which are imported from Calc tables. Some of the rows in the update table have customer ids, and some don’t. This update is to take the pID’s from the update table and update the null pID’s in the master customer table:
update “tbl_Import”
set “tbl_Import”.“pID” = (select “tbl_People”.“pID”
from “tbl_People”
where “tbl_Import”.“Nachname” = “tbl_People”.“Nachname”
and "ti.“Vorname” = “tbl_People”.“Vorname”
and rownum < 2)
where “tbl_Import”.“pID” is NULL
The message I get from Base when I execute this from Tools->SQL is:
1: Unexpected token: VORNAME in statement [update “tbl_Import”
set “tbl_Import”.“pID” = (select “tbl_People”.“pID”
from “tbl_People”
where “tbl_Import”.“Nachname” = “tbl_People”.“Nachname”
and "ti."Vorname]
This works just fine when I enter it in an Oracle database with the same tables and data. Does Base not recognize sub-queries?