Insert only not updated in tabular form
Hi friendI want to insert the value using tabular form, but I don't want to update the value in a table.
in fact I create a page with sub form of table and I select to update and insert option but here I want to insert value only in the table.
Is it posible.
How can I do that.
Thank you
Maury
Maury:
You can simply remove the buttons and the process of page corresponding to the Insert actions & update of the definition of the page.
CITY
Tags: Database
Similar Questions
-
Enter the name of app_user by updating the tabular form of builtin apex
Hi people,
I am a new to apex and trying to implement a tabular apex that has only an editable field box and form two audit field. Last updated by and updated, I use the built-in tabular form Apex.
Properly put form to update the field box to check and it works as it is supposed to be, the two audit field and Updated_by Update_date, I'm updating via slot table form and not updated.
Any help will be much appreciated. After the code that I use in the application process after submit
BEGIN
II in 1... APEX_Application.g_f02. COUNTY
LOOP
(ii) apex_application.g_f08: =: sysdate;
apex_application.g_f09 (II (: = v ('APP_USER');))
/*
UPDATE MG_RESTRICTION_DEV SET UPDATED_BY = v ('APP_USER')
WHERE MG_ID = APEX_APPLICATION. G_F05 (II);
*/
END LOOP;
END;
My goal is to use the max integrated apex and want to use the default MRU apex process. I get the success message, but the value does not get updated on the table.
Thank you
Shabbir
Published by: user13413381 on July 4, 2011 10:39Post this question in the forum asking Express. This is the forum of forms.
-
Automatic update of tabular form
I have a tabular layout with several editable fields created from a view and using a trigger to update the specific data fields that can be changed or entered instead. The data entered in the updates of this form without problem. My problem is that I would like to automatically update two fields in the database, (is displayed and you're not), when the specific fields in the form of tables are entered. I tried a PL ON process/SUBMIT SQL runs when you push the button SUBMIT. I get my success message, but the database does not get updates
Start
If: f12 is not null and: f13 = 'Now' then
Update [email protected]
Set mail_date = sysdate, treated = 'Y '.
where: f02 = request_detail_id;
end if;
end;
You can provide any assistance will be greatly appreciated. Thank you.
JCJC
Your following update statement references table "f12" and "f13. What columns of tables these correspond to the? You can use the
'View form information' tab of the toolbar of developer for this track.
Also at the point of Scott, in which the clause where reference you the table "f02" shouldn't you have "i" instead of "1"begin FOR i IN 1 .. apex_application.g_f02.COUNT LOOP update APEX_TR_OPEN_REQUESTS_V set d_mail_date = sysdate, d_processed = 'Y' where apex_application.g_f02(1) = d_request_detail_id and apex_application.g_f12(i) = 'N' and apex_application.g_f13(i)='Now'; end loop; end;
CITY
-
Date picker not working only not on the quote form
I inserted the date picker in a form field in my registration form CITES. It works in preview of web forms, but when I insert nothing happens. Here's the example site: http://coopsupport.businesscatalyst.com/
I tried the insertion is in HTML and as a module and neither worked. What did I miss?
Thank you. That pointed me in the right direction. This is the jquery script - 1.4.4.min.js. It was part of the model starting I used one of your model canned ecommerce sites. After removing that it worked. I could try to update the script to a newer version of JQuery and see how it goes. But we're all good now.
Paul
-
Insert automatically the values in tabular forms
Hello.
I have a page with a regular shape and a tabular form. The tabular presentation is shows the result of a query on a table called CONTACT_DETAILS...
Select * from CONTACT_DETAILS
where CONTACT_DETAILS. USER_ID =: P5_ID
... and: P5_ID is a hidden field on the ordinary form.
In the settings in a table, the CONTACT_DETAILS column. User_id is hidden. When a user clicks on the button "Add a line", fills the new line of cells, and then click on 'Submit', how can I ensure that the current value of: P5_ID is written in the hidden cell USER_ID for this line?
Thank you
NickThe hidden column can have a default value of type question and there you can put the name of the element as follows:
P1_HIDDEN_ITEM
Denes Kubicek
------------------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------------------ -
helps with the update of tabular form using dynamic Action
Hello world
I'm trying to simplify a tabular presentation based on a collection so that it uses more dynamic actions that will be ultimately more easy for us to debug.
Our tabular presentation is based on the query:
SELECT apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow", seq_id, seq_id display_seq_id, c003, c004, c005, c006, apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit, apex_item.select_list_from_LOV(8,c008,'DISPOSITIONS','onchange="getAllDisposition('||seq_id||')"','YES','0',' -- Select Favorite -- ','f08_'||seq_id,'') Disposition, apex_item.select_list_from_LOV(9,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus('||seq_id||');"onchange="getAllGears('||seq_id||')"','YES','3333','-- Select Favorite --','f09_'||seq_id,'') Gear, apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity, apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price, apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice ('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars, decode(c013,'Y',apex_item.text(14, c014,30,null,'style="background-color:#FBEC5D;" onClick="onFocusAreaFished('||seq_id||');"','f14_'||seq_id,''),'N','N/A') Area_Fished, c014, c015, c016, c017 additional_measure_flag, decode(c017,'Y',apex_item.text(18, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity('||seq_id||')"','f18_'||seq_id,''),'N','N/A') UNIT_QUANTITY, decode(c017,'Y',apex_item.text(19,'CN',3,null,'readOnly=readOnly;','f19_'||seq_id,''),'N','N/A') UNIT_COUNT, c024 fins_attached, apex_item.textarea(28,c028,3,null,'class="hms_info"','f28_'||seq_id,'') Explanation, decode(c024,'N',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','class="hms_info"''onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'U',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'Y','N/A') Nature_Of_Sale, c030, c031, c032, c033, c034, c035, c036, c037, c038, c039, apex_item.select_list_from_LOV(40,c040,'HMS_AREA_CODE','style="background-color:#FBEC5D;" class="hms_info" ',null,null,null,'f40_'||seq_id,'') HMS_AREA_CODE, c020 hms_flag, apex_item.text(41,TO_NUMBER(c041),5,null, 'class="hms_info"','f41_'||seq_id,'') Sale_Price, c042, c043, c044, c050 shark_flag from apex_collections where collection_name = 'SPECIES_COLLECTION' order by seq_id
Note that many of the fields referenced are c0xx... and really serve as place holders so that the c0xx = fxx. It's awkward, like every time that a movement or move a column, it upsets the fxx value. So, I tried to use the CLASS if possible.
I have a dynamic action that had worked perfectly, until I moved one of the columns... and now, it seems not to work when I'm trying to update anything with the HMS_INFO or SHARK_INFO class. Grrr.
dynamic action: CHANGE COLUMN
event: CHANGE
selection type: JQUERY SELECTOR
jQuery selector: input [name = 'f10'], input [name = 'f11'], input [name = 'f12'], input [name = "f24"], textarea [name = "f28"], select [name = "f40"], input [name = "f41"]
true action1: defined value, expression javascript, set P110_ID = this.triggeringElement.id
true action2: defined value, expression javascript, set P110_VALUE = this.triggeringElement.value
true action3: run pl/sql,.
declare v_attr number; v_seq number; begin v_attr := TO_NUMBER (SUBSTR (:p110_id, 2, 2)); select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual; safis_collections.update_column(v_seq, v_attr, :p110_value); end;
the safis_collections.update_column package is:
procedure update_column(v_seq in varchar2, v_attr in number, v_value in varchar2) is begin apex_collection.update_member_attribute (p_collection_name=> 'SPECIES_COLLECTION', p_seq => v_seq, p_attr_number => v_attr, p_attr_value => v_value); apex_debug.message('updated column. seq='||v_seq||' attribute='||v_attr||' with '||v_value); end;
I wonder if there is a way to make the CLASS in my JQUERY SELECTOR, so something like reference entry [class = "HMS_INFO"], input [CLASS = "shark_info"]... and if so, what happens if a single item in the class is an option button and the other is a selection list and the other an element?
is it possible to not have to rely on the fxx. Currently, my collection columns map to the investment in the form of tables... sense, c024 = f24... because I placed c024 to be the 24th editable column, but this seems crazy. Is there a simpler way? I'm just learning class, then maybe there is something extra, or rather that I could use...
any help is appreciated. Thank you!
I think I have solved the problem.
dynamic action: CHANGE COLUMN
event: CHANGE
selection type: JQUERY SELECTOR
jQuery selector: input [name = 'f10'], input [name = 'f11'], input [name = 'f12'], .shark_info, .hms_info
true action1: defined value, expression javascript, set P110_ID = this.triggeringElement.id P110_VALUE POINT KEYS
true action2: run pl/sql code
begin null; end;
items to submit page: P110_ID
true action3: defined value, expression javascript, set P110_VALUE = this.triggeringElement.value P110_VALUE POINT KEYS
true Action4: value: PL/SQL expression, the value P110_SEQ = rtrim (substr(:P110_ID,5,4),'0 ') CONCERNED POINT: P110_SEQ
true Action5: run pl/sql code
declare v_attr number; begin v_attr := TO_NUMBER (SUBSTR (:P110_id, 2, 2)); apex_collection.update_member_attribute (p_collection_name => 'SPECIES_COLLECTION', p_seq => :P110_SEQ, p_attr_number => v_attr, p_attr_value => :P110_VALUE); end;
items to submit page: P110_ID, P110_VALUE, P110_SEQ
true action6: refreshment area
I think it is the combination of the use of pl/sql expression to calculate P110_SEQ and also your tip on TRUE ACTION2 to submit the item that did the trick.
Thanks Kofi, for your patience and help! It was great.
Ugh... on the next issue.
Karen
-
Update / drop / tabular form
Hallo,
my name is Rene and need your help.
I have two tables
1 DIM_TIER
Tier_ID Tier_bezeichnung 1 Hund 2 Katz 3 Vogel 2 FAKT_ZOO
Besitzer_ID TIER_ID BESITZER_NAME 1 1 TIM 2 2 TOM 3 3 TUM Now I join the tables
Select DT.Tier_Bezeichnung, FZ.Tier_Bezitzer From Fakt_Zoo FZ INNER JOIN DIM_TIER DT on FZ.TIER_ID = DT.TIER_ID;
Result:
DT. TIER_BEZEICHNUNG FZ. TIER_BESITZER Hund TIM Katze TOM Vogel TUM In my Apllication of the Apex, I take a tabular presentation. The FZ column. TIER_BEZEICHNUNG is "the SELECTION LIST (QUERY BASE LOV) with SQL:
Select Tier_Bezeichnung, Tier_ID FROM DIM_TIER
Watt, I want: if I now change the value of DT. Tier_Bezeichnung with the drop (HUND, KATZE, VOGEL), the TIER_ID has changed in the FAKT_ZOO table after you click the Send button
Watt arrived: Notihng! Only an error: no data in tables found. Call your admin.
Can you help me?
Hi René,.
What is your source tabular query? It should be
SELECT besitzer_id, tier_id, besitzer_name
OF fakt_zoo
And for the "tier_id" column, you must set "LIST SELECT (QUERY BASED LOV)" with the query you specified above.
Then you should see the names of animals, but animal ID be passed when update (presentation).
BR,
Daniel
-
HTTPService read only not update xml, I had manually update the xml code in my browser
I called a HTTPService (id = data2php) that runs a php script that creates an xml doc and put it on my server. I then called another HTTPService (id = feedRequest) that reads the xml document, then I try to fill a datagrid with the lastResult my HTTPService that reads the xml doc. My question is that the HTTPService that reads the xml doc reads the previous incarnation of the doc xml, not the newly created that created my HTTPService (data2php). I've been manually the xml doc is going in my browser and hit refresh for my HTTPService feedRequest to read the updated xml code.
Here is the mxml for the httpservice that reads the xml file:
"" < mx:HTTPService id = "feedRequest" url = " http://cfcdi.org/eric/dashboard/php/sales.xml" result = "feedResult (event)" resultFormat = "xml" useProxy = "false" / > "
pretty simple.
(in fact, from time to time it will read the updated)N ° dummy Variable like this:
-
The documents that I have inserted with SQL do not appear in table form
Hi all -
I have not tried to reproduce this on apex.oracle.com yet, as I think that this may be a question easily answered:
I have a page with an LOV, a graphic and a shape table all based on the same table. Everything has been working fine without any problems. Today, I updated the table using SQL Developer and introduced a few new lines in the table. The LOV and the graphic on my page reflect the new lines that were inserted through SQL, but the tabular form is not seeing them. When I select a value LOV that must return some new lines, my tabular report shows simply no found data. If I copy the SQL of the tabular report definition and run it in SQL Developer, all the appropriate lines are returned.
Maybe I don't understand tabular forms. Any way to solve this problem or do I need to refresh the Page? Is the problem with the ID of the LINE or something?
All ideas are as much appreciated - thank you.
JohnUseful is fine. I don't know if these things can be changed.
Well, they say: ' it's always the last place you want! "? Some of them can make you tear your hair out.
My approach is 1) to display as much data as possible to ensure that data values are what you think they are. Often, they are not. And, (2) 'believe the error message.
Best wishes
Howard -
Insert/update of the lines in tabular form from one table to another table
Hello
I'm having a tabular presentation for a table (equip_test) with 2 columns (equip_id, equip_name). I create a new
Button (submit_alt) in this tabular form. I need to insert or update lines that are changed in this table to form
another table (equip_staging) when you press the submit_alt button. How can I do this? How can I identify which lines are
Insert or update? The process of the page I am trying since this button is
But it does not work. Help, pleasebegin FOR i in 1..APEX_APPLICATION.G_F01.count LOOP insert into equip_staging values(APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F03(i)); END LOOP; end;
Thank you
TJUnchecking (does not) the column is a problem. Use this SQL instead (which is included in my examples):
SELECT empno, empno || apex_item.hidden (33, wwv_flow_item.md5 (ename, sal, job)) empno_display, ename, sal, job FROM emp
and join this column hidden from your display column. In this way, it should work. When you feel there is no data found message in the treatment in a table, it will mean that the id does not exist.
Denes Kubicek
------------------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------------------ -
GUI of tabular forms refreshing not properly after update
Hello
I have a few apps using a tabular presentation which is not updated correctly. They are all views on the base with a couple of them having triggers to handle the update.
When the screen is refreshed after the update, it shows the original data before the user made the change. However, the database is updated correctly and the shape is correct after the update of the browser.
I have tried everything I can think of, changing reconstruction through settings on the update/post process, as well as the report itself. I'd also appreciate a work-around, which is a way to redirect to the same page but to force a refresh.
Here, any help would be appreciated.
Thank you.
MWTDon't remember how, but this problem has disappeared.
-
How to refer to the primary key column of newly inserted rows of tabular form
Hello
I use APEX 4.2.0.00.27 with Oracle DB 11.2.0.3.0.
I work with a tabular presentation wizard-created for insert and update a table using the integrated SRM process (sequence 10). I'm trying to use a process of anonymous block of PL/SQL (sequence 30) to make another manipulation of table after the records were inserted or updated. The manual process is associated with my tabular form and I use the variables of name of column binding in my program block.
My (rsn_test) table has 3 columns: test_id (number), test_nbr (number), test_id2 (number). Test_id column is identified as the primary key and the type of the source already exists a sequence rsn_test_seq. Column test_id2 gets its default value 0 to a hidden page element.
I would use my manual process for updating the value of the test_id2 column. If it's 0 then I want to put the value of the column test_id. If it is any other value, then it must remain at this value. My logic works very well for an existing line, but I'm running into a problem with the newly added lines. The new lines get inserted, but the test_id2 column remains the default value 0. I can tell the debugger that the SRM process is triggered first and inserts the line, then my manual dealing with fires. The problem seems to be that the connection variable: TEST_ID for the primary key column remains NULL after insertion. I don't know how to get the value of the column test_id of my newly created line to use in my PL/SQL block to my update.
Process of PL/SQL:
DECLARE BEGIN :P7_SHOW := NULL; :P7_SHOW := NVL(:TEST_ID2,555) || ' and ' || NVL(:TEST_ID,787) || ' and ' || NVL(:TEST_NBR,9999); IF :TEST_ID2 = 0 AND :TEST_ID IS NOT NULL THEN UPDATE rsn_test SET test_id2 = :TEST_ID WHERE test_id = :TEST_ID; ELSE :TEST_ID2 := :TEST_ID2; END IF; END;
Excerpt from the debugger:
0.01625 0.00010 Processes - point: ON_SUBMIT_BEFORE_COMPUTATION 0.01635 0.00008 Branch point: Before Computation 0.01643 0.00003 Process point: AFTER_SUBMIT 0.01646 0.00022 Tabs: Perform Branching for Tab Requests 0.01668 0.00008 Branch point: Before Validation 0.01676 0.00024 Validations: 0.01700 0.00135 Perform basic and predefined validations: 0.01835 0.00020 Perform custom validations: 0.01855 0.00049 ...Validation "TEST_NBR must be numeric" - Type: ITEM_IS_NUMERIC 0.01904 0.00007 ......Skip for row 1 because row hasn't changed 0.01911 0.00016 ......Skip for row 2 because row hasn't changed 0.01927 0.00012 ...Validation "TEST_ID2 must be numeric" - Type: ITEM_IS_NUMERIC 0.01939 0.00007 ......Skip for row 1 because row hasn't changed 0.01945 0.00018 ......Skip for row 2 because row hasn't changed 0.01964 0.00005 Branch point: Before Processing 0.01968 0.00004 Processes - point: AFTER_SUBMIT 0.01972 0.00588 ...Process "ApplyMRU" - Type: MULTI_ROW_UPDATE 0.02560 0.00154 ...Execute Statement: declare function x return varchar2 is begin begin for c1 in ( select "RSN_TEST_SEQ".nextval pk from sys.dual ) loop return c1.pk; end loop; end; return null; end; begin wwv_flow.g_value := x; end; 0.02714 0.00140 ......Row 3: insert into "APPPCSRSN"."RSN_TEST" ( "TEST_ID", "TEST_NBR", "TEST_ID2") values ( :b1, :b2, :b3) 0.02854 0.00011 ...Process "ApplyMRD" - Type: MULTI_ROW_DELETE 0.02865 0.00004 ......Skip because condition or authorization evaluates to FALSE 0.02869 0.00015 ...Process "Process Submit" - Type: PLSQL 0.02884 0.00007 ......Skip for row 1 because row hasn't changed 0.02891 0.00012 ......Skip for row 2 because row hasn't changed 0.02903 0.00012 ......Process row 3 0.02915 0.00429 ...Execute Statement: begin DECLARE BEGIN :P7_SHOW := NULL; :P7_SHOW := NVL(:TEST_ID2,555) || ' and ' || NVL(:TEST_ID,787) || ' and ' || NVL(:TEST_NBR,9999); IF :TEST_ID2 = 0 AND :TEST_ID IS NOT NULL THEN UPDATE rsn_test SET test_id2 = :TEST_NBR WHERE test_id = :TEST_ID; ELSE :TEST_ID2 := :TEST_ID2; END IF; END; end; 0.03344 0.00013 ...Session State: Saved Item "P7_SHOW" New Value="0 and 787 and 1300" 0.03356 0.00004 Branch point: After Processing 0.03360 0.00048 ...Evaluating Branch: "AFTER_PROCESSING" Type: REDIRECT_URL Button: (No Button Pressed) Condition: (Unconditional) 0.03407 0.00013 Redirecting to f?p=290:7:8717971109610:::::&success_msg=0%20row(s)%20updated%2C%201%20row(s)%20inserted.Success%2FEBD244168556408CBA714E3974918C09%2F 0.03420 0.00012 Stop APEX Engine detected 0.03432 0.00007 Stop APEX Engine detected 0.03439 - Final commit
Any suggestions?
I have run tests on
https://apex.Oracle.com/pls/apex/f?p=83488:1 demo/demo
to see your problem.
I have 2 solution for your problem.
I add trial NOT tabular just usual block of PL/SQLBEGIN I'm IN (SELECT TEST_ID FROM RSN_TEST WHERE TEST_ID2 = 0) LOOP UPDATE RSN_TEST SET test_id2 = TEST_ID WHERE test_id = i.TEST_ID; END LOOP; END; and works very well, you can see in the sample.
The other solution is to show new generated TEST_ID
Adding a sequence as a default value for a column in a table field
And to execute your procedure.
I get how is with the good luck of time.
By
-
tabular form - update the non-visible fields
Hi gurus!
I built a tabular form over a table composed of 6 fields and I use the MRU to allow the user to edit the record; Two field in that table are not visible and editable by the user; I want to use the two fields to track which change the record (both fields are Modify_USER, Modify_date).
I want to insert in the two fields the values the user variable and the sysdate.
Is it possible, is there a way to do this with MRU or do I have to manually write the PL/SQL for this?
I'm on APEX 3.2
Any suggestion will be appreciated.
Thanks in advance,
DDFInstead of doing it this way, why not watch a trigger in the database, which will fill these columns when you perform an update on the table? The user will be & user_id. and the sysdate you already...
CREATE OR REPLACE TRIGGER Update_Table_X BEFORE UPDATE of Table_X ON R_RECORDS FOR EACH ROW BEGIN :new.Modify_date := sysdate; :new.Modify_USER := app_user; END;
Thank you
Tony Miller
Webster, TXA lady came up to me on the street, pointed at my suede jacket and said: "do you not know that a cow was murdered for that jacket?
' I didn't know there are witnesses ', I replied: "now, I'll have to kill you too. ' -
Insert only the fields updated
I have a log table that is based on the main table. The main table have 50 frames. Any updates in the master data shall be recorded in a new table. If the main table will be only the latest data updated.
Any change in the main to insert in a connected table table. I need to insert only the fileds all fields update.
How to write the insert statement in forms 6i for insertion in a connected table where only the fields changed.
INSERT TO EMASTER_LOGTABLE
(ECODE,
ENAME,
EDEPT,
ETRADE
)
VALUES
(: ECODE,)
: ENAME,
: EDEPT,.
: ETRADE
)
Line will be inserted in the EMASTER_LOGTABLE with the field updated only not all fields, except primary.ORA-01858 is returned when you switch from the non-numeric characters at a time. SQL more:
SQL> SELECT To_date('##') as MY_DATE from DUAL;
SELECT To_date('##') as MY_DATE from DUAL
*
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expectedIf you notice, in the code, I gave you above, I created a special 'NvlDate' to use all NVL functions where you are testing for a date.
Put it in your trigger and use it on EACH column which is a date.
+(... I not create NVLDate for no reason!) +
-
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE Production 11.2.0.4.0
AMT for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
I create the structure of the table like that.
create table test1 (a primary key, b (2) char number, date c, d varchar2 (10), date of e);
create table test2 (number of ab, cd (2) tank, date of the ef, gh varchar2 (10), date of the ij, kl varchar2 (100));
Create materialized view log on test1;
create materialized view fast refresh test1_v on commit in select * from test1;
I have create a trigger of the sample
CREATE OR REPLACE TRIGGER test1_trig
AFTER INSERT OR UPDATE OR DELETE
ON test1_v
FOR EACH LINE
DECLARE
lr_test2 test2% ROWTYPE;
lv_error VARCHAR2 (4000);
BEGIN
lr_test2. AB: =: NEW.a;
lr_test2. CD: =: NEW.b;
lr_test2. GH: =: NEW.d;
IF THE INSERTION
THEN
lr_test2. EF: = SYSDATE;
lr_test2.IJ: = SYSDATE;
lr_test2.KL: = 'INSERT ';
INSERT INTO test2
VALUES lr_test2;
ELSIF UPDATE
THEN
lr_test2.IJ: = SYSDATE;
lr_test2.KL: = 'UPDATE ';
UPDATE test2 = lr_test2 ab WHERE = LINE: OLD.a;
ELSIF REMOVAL
THEN
DELETE FROM test2
AB = WHERE: old.a;
END IF;
EXCEPTION
WHILE OTHERS
THEN
lv_error: = SQLERRM;
INSERT INTO XXDOMINO_FG_DATA_LOAD_ERROR
VALUES ('test1_trig',
: OLD.a,.
"test1_trig,"
LV_ERROR,
SYSDATE);
COMMIT;
END test1_trig;
/
So, if check you my code,.
When I insert EF = SYSDATE, IJ = SYSDATE.
Update EF is not changed, IJ = SYSDATE.
So I like to capture their insertion and update dates.
But if updates or insert arrives on the materialized table. The trigger themselves as an INSERT only.
So how do you capture the updates?
I use the statemnet with out merger with performance and also able to capture the update dates.
CREATE OR REPLACE TRIGGER test1_trig_merge
AFTER INSERT OR UPDATE OR DELETE
ON test1_v
FOR EACH LINE
DECLARE
lr_test2 test2% ROWTYPE;
lv_error VARCHAR2 (4000);
BEGIN
IF THE REMOVAL
THEN
DELETE FROM test2
AB = WHERE: old.a;
ELSIF INSERTION
THEN
MERGE INTO test2 one
B using (SELECT 1 FROM DUAL)
WE (ab =: new.a)
WHEN MATCHED
THEN
UPDATE the VALUE ab =: NEW.a.
CD =: NEW.b,
GH =: NEW.c
IJ = SYSDATE,
KL = "Update"
AB WHERE =: old.a
WHEN NOT MATCHED
THEN
INSERTING VALUES (: NEW.a,)
: NEW.b,.
: NEW.c.
: NEW.d,.
: NEW.e,.
"INSERT");
END IF;
EXCEPTION
WHILE OTHERS
THEN
lv_error: = SQLERRM;
INSERT INTO XXDOMINO_FG_DATA_LOAD_ERROR
VALUES ('test1_trig',
: OLD.a,.
"test1_trig,"
LV_ERROR,
SYSDATE);
END test1_trig_merge;
/
DISPLAY ERRORS;
Maybe you are looking for
-
NB200-10Z - how to restore factory settings?
Hello I seem to have a pretty annoying problem with the NB200 - 10Z.The operating system is WinXP SP3. I was looking to restore it to its factory settings by using the tools of Toshiba, pressing F8 during the boot sequence, this however does not take
-
Why my computer is not verified to download an application?
I just tried to download whatsapp on my desk and he says "an unexpected error has occurred all. by signing Your device or the computer could not be verified. Contact technical support for assistance. "I don't know how to check my appleID is signed to
-
How can I restore crlt-alt-del? for my master?
How can I restore crlt-alt-del? for my master?
-
I've made a change to a file, and then click "Run now", but when I did a restore of this file, the recent change didn't happen?
-
Problem Adobe CC please help... !
Community in the morning,and even though I subscribed to one only produces for about a week Adobe CC and I have never been so stressed and angry in a week!Here's what I... invite me Adobe CC low install as usual... work and prepare all brush, models