Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert update a table with a view as source

748853Feb 12 2010 — edited Feb 12 2010
Hi,
I have two tables, a view which joins this two tables into one - now i want to insert the data from this view into a third table



Table PP_SPALTEN
SCHEMATA,SPALTE,TEXT
------------------------------
0100,"+0100+","9"
0100,"+0200+","8"
0100,"+0300+","7"
0100,"+0400+","6"
0100,"+0500+","5"


Table PP_ZEILEN
SCHEMATA,ZEILE,TEXT
------------------------------
0100,"0110","A1"
0100,"0220","A2"
0100,"0330","A3"
0100,"0440","A4"
0100,"0550","A5"

Table PP_DATEN

SCHEMATA,SPALTE,ZEILE,WERT
--------------------------------------------

CREATE OR REPLACE VIEW pp_dynamisch (
schemata,
spalte,
zeile )
AS
select a.schemata,a.spalte, b.zeile from pp_spalten a, pp_zeilen b where a.schemata = b.schemata


SCHEMATA,SPALTE,ZEILE
------------------------------
0100,"+0100+","0110"
0100,"+0100+","0220"
0100,"+0100+","0330"
0100,"+0100+","0440"
0100,"+0100+","0550"
...


I am trying to get the combined data from pp_spalten & pp_zeilen into one table.
So if i insert or update on of the tables pp_spalten and/or pp_zeilen the data should come into the third table pp_daten (maybe i dont need the view - i don't know)

The background of my qustion is, that we a creating a asp-website with a grid Table
In PP_Spalten.Spalte are the values for the grid columns and
in PP_Zeilen.Zeile are the values for the rows.
We are trying to create a grid dynamically out of an column table (pp_spalten) and a row table (pp_zeilen)

If this grid is created, the user can input financial information (pp_daten.WERT)and save it.

Ps: I found out that in 11g there is the possibility to get rows into columns and back with the PIVOT-command.
I have in asp a very dynamical pivot grid with a lot of ajax code behind.
So i only need to know how to keep pp_daten up-to_date when i change data on the "source" tables (pp_spalten, pp_zeilen)

thanks for helping

Edited by: user5389066 on 12.02.2010 04:50
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2010
Added on Feb 12 2010
9 comments
755 views