Re: Mehrere updateabel Regionen auf einer Seite
geschrieben von:
FrankLehmann (62.153.148.---)
Datum:
Hallo Eldri,
du must unterschiedliche Selects selbst zusammenbauen und jeweils einen Update Prozess einrichten. Sieht in etwa so aus:
Select apex_item.hidden(1,'Primary Key von Tabelle 1) Spalte1,
apex_item.text(2,'zu änderner wert aus tabelle 1) Spalte2,
APEX_ITEM.MD5_CHECKSUM(Spalte1,spalte2)
from tabelle 1
Select apex_item.hidden(3,'Primary Key von Tabelle 2) spalte1,
apex_item.text(4,'zu änderner wert aus tabelle 2) spalte2,
APEX_ITEM.MD5_CHECKSUM(Spalte1,spalte2)
from tabelle 2
Achte auf die fortlaufende Nummerierung.
Danach noch den Update bzw. Insert Prozess implementieren. (after submit)
for i=1 .. apex_application.g_f01.count (für Tabelle 1)
loop
update tabelle 1
set Spalte1 = apex_application.g_f02(i)
where
Primary Key = apex_application.g_f01(i);
end loop;
for i=1 .. apex_application.g_f03.count (für Tabelle 2)
loop
update tabelle 1
set Spalte1 = apex_application.g_f04(i)
where
Primary Key = apex_application.g_f03(i);
end loop;
Wichtig ist die Spalte checksum, damit eindeutig auf Änderungen referenziert werden kann.
Alles andere steht in der Dokumentation zu apex_item und der Funktion apex_application.g_f0x für ein MultiRowUpdate.
Ich hoffe, es reicht erstmal so.
Gruß
Frank