You can write a small Postgresql loop to iterate over all the tables you want.
With this query, you get all tables.
SELECT table_name, table_schema FROM information_schema.tables
Probably you don't want all tables. In the loop below, you can uncomment the WHERE clause just to select the tables you want.
The loop looks like this:
DO $do$
DECLARE
sch text; tbl text; tblfullname text;
BEGIN
sch := 'public';
FOR tbl, sch IN SELECT table_name, table_schema FROM information_schema.tables -- WHERE table_schema = sch and table_name ilike '%mytables%'
LOOP
tblfullname := format($$%s.%s$$, sch, tbl);
raise notice 'UPDATE TABLE: %', format($$ UPDATE %s ab set elem_nr = ef.elem_nr FROM ga_mit_elemnr ef WHERE (ab.elem_nr NOT IN (SELECT elem_nr FROM strassenelemente cd) OR ab.elem_nr IS NULL) AND ST_WITHIN(ab.geom, ef.geom); $$, tblfullname );
EXECUTE format($$ UPDATE %s ab SET elem_nr = ef.elem_nr FROM ga_mit_elemnr ef WHERE (ab.elem_nr NOT IN (SELECT elem_nr FROM strassenelemente cd) OR ab.elem_nr IS NULL) AND ST_WITHIN(ab.geom, ef.geom); $$, tblfullname );
END LOOP;
END;
$do$;
The raise notice is just for debugging.