0

my problem is that I only know the new name of the owner of the house with id_house = 10, so this code should work. If i try to run it in LibreOffice Base, it says unexpected end INNER, requires SET statement [update "t_Owner" inner] Can you help me? Sorry for my bad english D:

update "t_Owner"
inner join "t_house"
    on t_house.id_ownerr = t_Owner.id_ownerr
set "name"='yes'
where "id_house" = '10'

t_Owner columns: id_ownerr, name, surname, address
t_house columns: id_house, id_district, id_ownerr

robz
  • 1
  • 2

2 Answers2

0
 update "t_Owner"
     set "name"='yes' where "id_ownerr" 
          IN ( SELECT "id_ownerr" FROM "t_house" where "id_house" = '10' )
Scott Dobbins
  • 294
  • 1
  • 8
0

In LO when using the default embedded data base, HSQLDB 1.8, queries (i.e. things that use a join) are not always updatability. In fact they are almost always not updateable.

To test this for yourself try creating a query with your join and the fields you need and see if it's updateable. Bet it's not.

You can move to using 2.3 (via a split database setup tool), or do what I do which is run in MariaDB and use a connector.

Elliptical view
  • 3,338
  • 1
  • 31
  • 28