Updating statistics after insert
Is it possible, without creating a custom post-map process, to update statistics after inserting rows into a table. I've tried setting different parameters within OWB to no avail.
Please respond only if you have actually succeeded in updating statistics without writing code. I've already read the docs and experimented.
Thanks.
Garrett
Hi,
why do you think so? The analyze configuration
results in a procedure which calls
WB_RT_MAPAUDIT_UTIL_INVOKER for each target table
which then calls the DBMS_STATS-Package? What is
misssing for the CBO? I'm a little bit confused?!
Regards,
DetlefThanks for the info. I'm a little confused. I thought that I had the analyze table box checked in the configuration and statistics were not updated. However, when I looked again, it was not checked. My error. Ran another test and statistics were updated. Sorry for the confusion.
G.
Similar Messages
-
Update by after insert trigger
I need to update each new inserted row of data by checking if there were same values in the table. So I tried the After Insert Trigger with the code below :
CREATE OR REPLACE TRIGGER approve_checker
after insert on TBL_BILL
for each row
declare
counter integer;
begin
SELECT COUNT() INTO counter FROM TBL_BILL WHERE issue_date=:NEW.issue_date AND wagon_no=:NEW.wagon_no ;*
IF( counter > 1)
THEN
UPDATE TBL_BILL SET approved = 2 WHERE id = :NEW.id;
END IF;
end approve_checker;
But errors accured :
ORA-04091: table RAIL.BILL is mutating, trigger/function may not see it
ORA-06512: at "RAIL.APPROVE_CHECKER", line 4
ORA-04088: error during execution of trigger 'RAIL.APPROVE_CHECKER'
Any help appreciated.You cannot SELECT from the table on which the row-level trigger is defined, nor can you UPDATE a table on which the row-level trigger is defined. If you are inserting multiple rows in a single INSERT statement, Oracle can't be sure what rows to update and/or select.
Is there a reason that you wouldn't just create a unique constraint to enforce this condition?
Justin -
Updating row after insert that causes trigger
Hi,
I have a table which one of the columns is a sequence number which each time a new row is written I want to automatically write to this sequence column the latest number (which is maintained using an Oracle sequence). I decided to use a trigger which works great:
CREATE OR REPLACE TRIGGER pre_insert_trg before insert ON INCOMING
for each row
BEGIN
SELECT INCOMING_SEQ.NEXTVAL
INTO :new.SEQ
FROM DUAL;
END;
The problem is I have many multi-threaded processes writing to this table and the sequence number gets allocated before the row is committed which means although thread 1 may write first it may commit after thread 2 which has a later sequence number which has the result that sequence number 2 may be shown before 1. The problem is much larger when dealing with many threads with 100's of messages a second and so I would prefer the seq to be added AFTER the insert (once committed), e.g.
CREATE OR REPLACE TRIGGER post_insert_trg after insert ON INCOMING
for each row
BEGIN
SELECT INCOMING_SEQ.NEXTVAL
INTO :new.SEQ
FROM DUAL;
END;
Trying to create this trigger results in a "ORA-04084: cannot change NEW values for this trigger type". Is there a way to update a column for the row which caused the trigger? If I try and remove the :new. I then get errors when inserting about mutating table (which I understand the DML locking but need a way round)
Many thanks,
JohnOff hand I think the only way you can do what you say you want to do is to replace the sequence with a code table. A transaction locks the code table, gets the next value from it and unlocks the code table at the end of the transaction. This ensures that the sequence number is always assigned in transaction completion order (or rather the transactions always complete in sequence assigned order). It is basically what java does with its synchronize statement.
The only drawback with this approach is that it completely shags the performance of the sort of multi-threaded environment you've just described. :P
So you need to decide what's more important: having stuff inserted into a queue in sequence order or having a multi-threaded system running quickly. I really don't see how you can acheive what you're attempting in a genuinely concurrent environment; you'll have to introduce an artificial serialism (ie bottleneck) somewhere.
If you do crack this please tell me how: I would be interested in ordering multiple AQs in the fashion you described.
Cheers, APC -
AFTER INSERT OR UPDATE TRIGGER the insert not working
The update works but the insert is not working. I have two version that I have tried. I amd executing the inserts/update from Oracle Applications and the table row is either being inserted or updated correctly.
DROP TRIGGER APPS.CCC_HZ_ORG_CONTACTS_ARU;
CREATE OR REPLACE TRIGGER APPS.CCC_HZ_ORG_CONTACTS_ARU
/* --Created By: SKELLEHER
--Creation Date: 07/15/09
--Last Updated By:
--Last Update Date:
AFTER INSERT OR UPDATE OF department, job_title
ON apps.hz_org_contacts
FOR EACH ROW
WHEN (
NEW.department <> OLD.department OR
NEW.job_title <> OLD.job_title
DECLARE
v_ChangeType VARCHAR2(10);
BEGIN
/* Use 'I' for Insert, 'U'' for Update, and'D' for delete(not part of app at this time). */
IF INSERTING THEN
v_ChangeType := 'INSERT';
ELSIF UPDATING THEN
v_ChangeType := 'UPDATE';
ELSE
v_ChangeType := 'DELETE';
END IF;
INSERT INTO cust.ccc_tca_po_tf_event_tbl
VALUES (ccc_tca_po_tf_event_tbl_s.NEXTVAL
, 'hz_org_contacts'
, v_ChangeType
, 'org_contact_id'
, :NEW.org_contact_id
, 'PENDING'
, NULL
, 0
, 'N'
, 'Y'
, :NEW.LAST_UPDATED_BY
, :NEW.LAST_UPDATE_DATE
, -1
, SYSDATE
, 'DEPARTMENT_JOBTITLE_UPDATE'
,'LDAP'
END;
AND I TRIED ANOTHER VERSION:I have simplified it so it's just checking for insert but it's not picking up. Is the syntax IF INSERTING correct?
CREATE OR REPLACE TRIGGER APPS.CCC_HZ_ORG_CONTACTS_ARU
AFTER INSERT OR UPDATE
ON ar.hz_org_contacts
FOR EACH ROW
DECLARE
BEGIN
IF INSERTING THEN
INSERT INTO cust.ccc_tca_po_tf_event_tbl
VALUES (ccc_tca_po_tf_event_tbl_s.NEXTVAL
, 'hz_org_contacts'
, 'UPDATE'
, 'org_contact_id'
, :NEW.org_contact_id
, 'PENDING'
, NULL
, 0
, 'N'
, 'Y'
, :NEW.LAST_UPDATED_BY
, :NEW.LAST_UPDATE_DATE
, -1
, SYSDATE
, 'DEPARTMENT_JOBTITLE_UPDATE'
,'LDAP'
END IF;
END;
/ -
SQL merge and after insert or update on ... for each row fires too often?
Hello,
there is a base table, which has a companion history table
- lets say USER_DATA & USER_DATA_HIST.
For each update on USER_DATA there has to be recorded the old condition of the USER_DATA record into the USER_DATA_HIST (insert new record)
- to have the history of changes to USER_DATA.
The first approach was to do the insert for the row trigger:
trigger user_data_tr_aiu after insert or update on user_data for each rowBut the performance was bad, because for a bulk update to USER_DATA, there have been individual inserts per records.
So i tried a trick:
Instead of doing the real insert into USER_DATA_HIST, i collect the USER_DATA_HIST data into a pl/sql collection first.
And later i do a bulk insert for the collection in the USER_DATA_HIST table with stmt trigger:
trigger user_data_tr_ra after insert or update on user_dataBut sometimes i recognize, that the list of entries saved in the pl/sql collection are more than my USER_DATA records being updated.
(BTW, for the update i use SQL merge, because it's driven by another table.)
As there is a uniq tracking_id in USER_DATA record, i could identify, that there are duplicates.
If i sort for the tracking_id and remove duplicate i get exactly the #no of records updated by the SQL merge.
So how comes, that there are duplicates?
I can try to make a sample 'sqlplus' program, but it will take some time.
But maybe somebody knows already about some issues here(?!)
- many thanks!
best regards,
FrankHello
Not sure really. Although it shouldn't take long to do a test case - it only took me 10 mins....
SQL>
SQL> create table USER_DATA
2 ( id number,
3 col1 varchar2(100)
4 )
5 /
Table created.
SQL>
SQL> CREATE TABLE USER_DATA_HIST
2 ( id number,
3 col1 varchar2(100),
4 tmsp timestamp
5 )
6 /
Table created.
SQL>
SQL> CREATE OR REPLACE PACKAGE pkg_audit_user_data
2 IS
3
4 PROCEDURE p_Init;
5
6 PROCEDURE p_Log
7 ( air_UserData IN user_data%ROWTYPE
8 );
9
10 PROCEDURE p_Write;
11 END;
12 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY pkg_audit_user_data
2 IS
3
4 TYPE tt_UserData IS TABLE OF user_data_hist%ROWTYPE INDEX BY BINARY_INTEGER;
5
6 pt_UserData tt_UserData;
7
8 PROCEDURE p_Init
9 IS
10
11 BEGIN
12
13
14 IF pt_UserData.COUNT > 0 THEN
15
16 pt_UserData.DELETE;
17
18 END IF;
19
20 END;
21
22 PROCEDURE p_Log
23 ( air_UserData IN user_data%ROWTYPE
24 )
25 IS
26 ln_Idx BINARY_INTEGER;
27
28 BEGIN
29
30 ln_Idx := pt_UserData.COUNT + 1;
31
32 pt_UserData(ln_Idx).id := air_UserData.id;
33 pt_UserData(ln_Idx).col1 := air_UserData.col1;
34 pt_UserData(ln_Idx).tmsp := SYSTIMESTAMP;
35
36 END;
37
38 PROCEDURE p_Write
39 IS
40
41 BEGIN
42
43 FORALL li_Idx IN INDICES OF pt_UserData
44 INSERT
45 INTO
46 user_data_hist
47 VALUES
48 pt_UserData(li_Idx);
49
50 END;
51 END;
52 /
Package body created.
SQL>
SQL> CREATE OR REPLACE TRIGGER preu_s_user_data BEFORE UPDATE ON user_data
2 DECLARE
3
4 BEGIN
5
6 pkg_audit_user_data.p_Init;
7
8 END;
9 /
Trigger created.
SQL> CREATE OR REPLACE TRIGGER preu_r_user_data BEFORE UPDATE ON user_data
2 FOR EACH ROW
3 DECLARE
4
5 lc_Row user_data%ROWTYPE;
6
7 BEGIN
8
9 lc_Row.id := :NEW.id;
10 lc_Row.col1 := :NEW.col1;
11
12 pkg_audit_user_data.p_Log
13 ( lc_Row
14 );
15
16 END;
17 /
Trigger created.
SQL> CREATE OR REPLACE TRIGGER postu_s_user_data AFTER UPDATE ON user_data
2 DECLARE
3
4 BEGIN
5
6 pkg_audit_user_data.p_Write;
7
8 END;
9 /
Trigger created.
SQL>
SQL>
SQL> insert
2 into
3 user_data
4 select
5 rownum,
6 dbms_random.string('u',20)
7 from
8 dual
9 connect by
10 level <=10
11 /
10 rows created.
SQL> select * from user_data
2 /
ID COL1
1 GVZHKXSSJZHUSLLIDQTO
2 QVNXLTGJXFUDUHGYKANI
3 GTVHDCJAXLJFVTFSPFQI
4 CNVEGOTDLZQJJPVUXWYJ
5 FPOTZAWKMWHNOJMMIOKP
6 BZKHAFATQDBUVFBCOSPT
7 LAQAIDVREFJZWIQFUPMP
8 DXFICIPCBCFTPAPKDGZF
9 KKSMMRAQUORRPUBNJFCK
10 GBLTFZJAOPKFZFCQPGYW
10 rows selected.
SQL> select * from user_data_hist
2 /
no rows selected
SQL>
SQL> MERGE
2 INTO
3 user_data a
4 USING
5 ( SELECT
6 rownum + 8 id,
7 dbms_random.string('u',20) col1
8 FROM
9 dual
10 CONNECT BY
11 level <= 10
12 ) b
13 ON (a.id = b.id)
14 WHEN MATCHED THEN
15 UPDATE SET a.col1 = b.col1
16 WHEN NOT MATCHED THEN
17 INSERT(a.id,a.col1)
18 VALUES (b.id,b.col1)
19 /
10 rows merged.
SQL> select * from user_data_hist
2 /
ID COL1 TMSP
9 XGURXHHZGSUKILYQKBNB 05-AUG-11 10.04.15.577989
10 HLVUTUIFBAKGMXBDJTSL 05-AUG-11 10.04.15.578090
SQL> select * from v$version
2 /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - ProductionHTH
David -
I updated my ipad2 to ios7 after that , iam facing problems with my sim, it showing no sim card after inserting sim. there is no prbolem with my sim.
arun kumar chenna123 wrote:
i have updated my iphone to ios4.1. after installation, it is showing as"The SIM card inserted in this iPhone does not appear to be supported. only compatible sim cards from a supported carrier may be used to activate iphone. Please insert the sim card that came with your iphone...."
how to solve this problem. I don't have any sim cards that came with iphone.
Please help out to solve this problem.
It sounds like the phone was hacked or jailbroken, and updating it locked it to the original carrier. As it is not possible to update to any version other than the current one (5.1) the fact that you updated to 4.1 pretty much confirms the phone was hacked. There is no solution that you can get in an Apple forum. -
Refreshing the RowSetBrowser webbean after insert/update(?)
How do I refresh the RowSetBrowser web bean after inserting or updating and committing a record thru the EditCurrentRecord web bean?
I am unable to see the new record added in the RowSetBrowser unless I close the browser and re-enter.
Any advice would be appreciated!
nullafter you call to iniatialize() in the DWB, you can refresh the cache by calling
<%
dbw.getRowset().executeQuery();
%> -
Response.write after insert/update
Hi
Could anyone please show me how to do a response.write message on the page after insert/update?
Wondering especially about the placement and the syntax of the response.
DWCS5, Access, Asp
ChristianI'm sorry to say I don't know how to test values in ASP, have just started to use it.
I didn't get it to work so I threw away the code and went for an ordinary text response on a second page.
Might as well get a book and read up on it -
Create trigger for after insert update
i have table tt (id number (10), name varchar2(20), status varchar2(1) , stage varchar2(1))
when i insert data in table tt
id name status stage
1 anil a
then trigger fire and update same value of satge to status
like
1 anil a a
pls give exampleHi,
please try this code:
CREATE OR REPLACE TRIGGER <tiggername>
AFTER INSERT OR UPDATE
ON TT
FOR EACH ROW
DECLARE
v_Status varchar2(10);
BEGIN
-- Insert record into audit table
INSERT INTO orders_audit
( id,
name,
stage)
VALUES
( :new.id,
:new.name,
:new.stage);
select stage into v_status
from tt where stage = new.stage
update tt set status = v_status where id = new.id
END; -
ORA-29532 exception from after insert update trigger
Trigger code:
CREATE OR REPLACE TRIGGER SAMS.PERS_ALG_AIU_TRG
AFTER INSERT OR UPDATE
ON PERS_ALG
FOR EACH ROW
DECLARE
trans_type VARCHAR2(1);
event_id CONSTANT VARCHAR2(7) := 'A31_ZA1';
data_src CONSTANT VARCHAR2(15) := 'SI_A31_ZA1_VW';
p_row_id ROWID;
select_stmt VARCHAR2(5000);
XMLString CLOB;
BEGIN
IF INSERTING THEN
trans_type := 'I';
ELSE
trans_type := 'U';
END IF;
SELECT ROWID
INTO p_row_id
FROM personnel
WHERE pers_seq = :new.pers_seq;
select_stmt := 'SELECT * FROM si_a31_ZA1_vw WHERE start_date = MAX(start_date) AND ROW_ID =chartorowid('''||p_row_id||''')';
-- Produce the XML
XMLString := si_lib.get_XML(select_stmt);
-- Insert the transaction
INSERT INTO si_transaction (transaction_type, event_id, status_id, timestamp, transaction_xml)
VALUES ( trans_type, event_id, 'CR', SYSDATE, XMLString);
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20040, sqlerrm);
END;
... is causing ORA-29532 JAVA call terminated by uncaught java exception: java.lang.nullPointerException
any ideas --- get_XML actually calls dbms_xmlquery.getXMLWhen in doubt, break it into pieces and test the pieces. The following is not valid:
SELECT * FROM si_a31_ZA1_vw WHERE start_date = MAX(start_date)
Try replacing the above with:
SELECT * FROM si_a31_ZA1_vw WHERE start_date = (SELECT MAX(start_date) FROM si_a31_ZA1_vw) -
Bc4j bug at refresh after insert / update
having a table and a trigger on it that fills an attribute
in a 9i db. one can take the scott/tiger emp table and use the
following trigger:
create or replace trigger t_bri_emp
before insert on emp
for each row
declare
v_no number(7,2);
begin
select user_SEQ.nextval*100
into v_no
from dual;
:new.sal := v_no;
end;
then creating a bc4j project with an entity object based on this table (emp)
and a view object based on the created entity object.
!!!! when you create the bc4j project you must set the SQL Flavor to SQL92 or OLite
when you set the attribute settings, for the attribute the trigger is on (sal),
to refresh after insert / update or both in the entity object you get a
null pointer when you try to insert a new row and commit.
java.lang.NullPointerException
oracle.jdbc.ttc7.TTIoac oracle.jdbc.ttc7.TTCAdapter.newTTCType(oracle.jdbc.dbaccess.DBType)
oracle.jdbc.ttc7.NonPlsqlTTCColumn[] oracle ....................
all can be reproduced just useing the wizard and start the bc4j project with the tester
any workaround ??Sven:
I looked into your issue. It turns out your problem is caused by a bug in the system (bug #2409955).
The bug is that for non-Oracle SQLBuilder, we are not processing refresh-on-insert and refresh-on-update attributes correctly. We end up forming an invalid SQL statement and the JDBC driver gives the obscure NullPointerException.
Thus, until 9.0.3, you should not use refresh-on-insert/update attributes on a non-Oracle SQLBuilder.
If you need the refresh-on-insert/update attribute, here is a possible workaround:
1. Whenever you invoke the tester, on the first panel, click on the 'Properities' tab. In the list of properties, you should find one for 'jbo.SQLBuilder'. It will say 'SQL92'. Remove it, so that it is empty. Run test tester. Then, the tester will use Oracle SQLBuilder which will handle refresh-on-insert/update attributes correctly for you.
2. For switching between Oracle SQLBuilder and SQL92 SQLBuilder, you can try the following:
2a) Locate bc4j.xcfg and your Project??.jpx under your 'src' directory.
2b) Make copies of these files.
2c) Edit them so that you have one set for Oracle SQLBuilder and one set for SQL92 SQLBuilder. For Oracle SQLBuilder, make sure these files do NOT have entries like:
<jbo.SQLBuilder>..</jbo.SQLBuilder> in bc4j.xcfg and
<Attr Name="_jbo.SQLBuilder" Value="..." /> in Project??.jpx
When there is no jbo.SQLBuilder entry, BC4J will default to Oracle.
For SQL92, make sure you have
<jbo.SQLBuilder>SQL92</jbo.SQLBuilder> in bc4j.xcfg and
<Attr Name="_jbo.SQLBuilder" Value="SQL92" /> in Project??.jpx.
Before you run, decide which SQLBuilder to use (for 9.0.2, with retrieve-on-insert/update attrs, you have no choice but to use Oracle SQLBuilder) and copy these files into your class path, e.g.,
<jdev-install-dir>\jdev\mywork\Workspace1\Project1\classes
When you get 9.0.3, then you should be able to switch between Oracle and SQL92 SQLBuilders freely.
Thanks.
Sung -
Capturing value in after insert or update row level trigger
Hi Experts,
I'm working on EBS 11.5.10 and database 11g. I have trigger-A on wip_discrete_jobs table and trigger-B on wip_requirement_operations table.When ever i create discrete job, it inserts record in both wip_discrete_jobs and wip_requirement_operations.
Note:2 tables are like master-child relation.
Trigger-A: After Insert.Row Level trigger on wip_discrete_jobs
Trigger-B:After Insert,Row Level trigger on wip_requirement_operations
In Trigger A:
I'm capturing wip_entity_id and holding in global variable.
package.variable:=:new.wip_entity_id
In Trigger B:
I'm using the above global variable.
Issue: Let's say i have create discrete job,it's wip_entity_id is 27, but the global variable is holding the previous wip_entity_id(26),not current value.It looks like before trigger A event is complete, trigger B is also in process, i think this could be the reason it's not storing the current wip_entity_id in the global variable.
I need your help how to have the current value in the global variable so that i can use that in the trigger B.
Awaiting response at the earliest.
Thanks798616 wrote:
Hi Experts,
I'm working on EBS 11.5.10 and database 11g. I have trigger-A on wip_discrete_jobs table and trigger-B on wip_requirement_operations table.When ever i create discrete job, it inserts record in both wip_discrete_jobs and wip_requirement_operations.
Note:2 tables are like master-child relation.
Trigger-A: After Insert.Row Level trigger on wip_discrete_jobs
Trigger-B:After Insert,Row Level trigger on wip_requirement_operations
In Trigger A:
I'm capturing wip_entity_id and holding in global variable.
package.variable:=:new.wip_entity_id
In Trigger B:
I'm using the above global variable.
Issue: Let's say i have create discrete job,it's wip_entity_id is 27, but the global variable is holding the previous wip_entity_id(26),not current value.It looks like before trigger A event is complete, trigger B is also in process, i think this could be the reason it's not storing the current wip_entity_id in the global variable.
I need your help how to have the current value in the global variable so that i can use that in the trigger B.
Awaiting response at the earliest.
ThanksMy head hurts just thinking about how this is being implemented.
What's stopping you from creating a nice and simple procedure to perform all this magic?
Continue with the global/trigger magic at your own peril, as you can hopefully already see ... nothing good will come from it.
Cheers, -
Hi Experts,
IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan for Daily/weekly??
Vinai Kumar GandlaHi Vikki,
Many systems rely solely on SQL Server to update statistics automatically(AUTO UPDATE STATISTICS enabled), however, based on my research, large tables, tables with uneven data distributions, tables with ever-increasing keys and tables that have significant
changes in distribution often require manual statistics updates as the following explanation.
1.If a table is very big, then waiting for 20% of rows to change before SQL Server automatically updates the statistics could mean that millions of rows are modified, added or removed before it happens. Depending on the workload patterns and the data,
this could mean the optimizer is choosing a substandard execution plans long before SQL Server reaches the threshold where it invalidates statistics for a table and starts to update them automatically. In such cases, you might consider updating statistics
manually for those tables on a defined schedule (while leaving AUTO UPDATE STATISTICS enabled so that SQL Server continues to maintain statistics for other tables).
2.In cases where you know data distribution in a column is "skewed", it may be necessary to update statistics manually with a full sample, or create a set of filtered statistics in order to generate query plans of good quality. Remember,
however, that sampling with FULLSCAN can be costly for larger tables, and must be done so as not to affect production performance.
3.It is quite common to see an ascending key, such as an IDENTITY or date/time data types, used as the leading column in an index. In such cases, the statistic for the key rarely matches the actual data, unless we update the Statistic manually after
every insert.
So in the case above, we could perform manual statistics updates by
creating a maintenance plan that will run the UPDATE STATISTICS command, and update statistics on a regular schedule. For more information about the process, please refer to the article:
https://www.simple-talk.com/sql/performance/managing-sql-server-statistics/
Regards,
Michelle Li -
Using Database Change Notification instead of After Insert Trigger
Hello guys! I have an after insert trigger that calls a procedure, which in turn is doing an update or insert on another table. Due to mutating table errors I declared the trigger and procedure as autonomously transactional. The problem is, that old values of my main tables are inserted into the subtable since the after insert/update trigger is fired before the commit.
My question is how can I solve that and how could I use the change notification package to call my procedure? I now that this notification is only started after a DML/DDL action has been commited on a table.
If you could show me how to carry out the following code with a Database Change Notification I'd be delighted. Furthermore I need to know if it suffices to set up this notification only once or for each client seperately?
Many thanks for your help and expertise!
Regards,
Sebastian
declare
cnumber number (6);
begin
select count(*) into cnumber from (
select case when (select date_datum
from
(select f.date_datum,
row_number() over (order by f.objectid desc) rn
from borki.fangzahlen f
where lng_falle = :new.lng_falle
and int_fallennummer = :new.int_fallennummer
and lng_schaedling = :new.lng_schaedling
and date_datum > '31.03.2010'
where rn=1) < (select date_datum
from
(select f.date_datum,
row_number() over (order by f.objectid desc) rn
from borki.fangzahlen f
where lng_falle = :new.lng_falle
and int_fallennummer = :new.int_fallennummer
and lng_schaedling = :new.lng_schaedling
and date_datum > '31.03.2010'
where rn=2) then 1 end as action from borki.fangzahlen
where lng_falle = :new.lng_falle
and int_fallennummer = :new.int_fallennummer
and lng_schaedling = :new.lng_schaedling
and date_datum > '31.03.2010') where action = 1;
if cnumber != 0 then
delete from borki.tbl_test where lng_falle = :new.lng_falle
and int_fallennummer = :new.int_fallennummer
and lng_schaedling = :new.lng_schaedling
and date_datum > '31.03.2010';
commit;
pr_fangzahlen_tw_sync_sk(:new.lng_falle, :new.int_fallennummer, :new.lng_schaedling);It looks like you have an error in line 37 of your code. Once you fix that the problem should be resolved.
-
"Refresh after" insert fails for DB-View with INSTEAD OF Triggers
Hi,
I have a database view with INSTEAD OF triggers defined for INSERT, UPDATE, DELETE.
For some EO attributes the refresh after insert and update is defined.
Posting to database fails.
According to Database 9.2 Manual and a previous thread (BC4J and Updatable Views the RETURNING clause is not allowed for database views with INSTEAD OF triggers.
Is there a workaround so the refresh after is done, but without the RETURNING feature?
I only need to refresh some values. The PK i can set in the create method of the EO so refresh via a additional SELECT would be possible.
If not Feature Request:
Add the possibility to do the "refresh after ..." with a 2nd SELECT using the PK instead of using the RETURNING clause.
Of course then it is not possible to set the PK in the database trigger. PK has to be set in the create method of the EO.
Thanks,
Markus
GEMS ITHi Markus,
Turning on the stack trace (-Djbo.debugout put=Console - in the Project/runner) did help and I should have done it sooner. Turns out that when I constructed my EO based upon a database view - I should have left out the PKs of the base tables.
In my case, I am using an "Instead Of Trigger" to populate a multi-table arrangement (parent - child - grandChild - greatGrandChild relationship) where all base tables are using dbSequence/dbTriggers.
Final analysis - I would like to see BC4J handle this situation. I do not want to use View-Links and I should * not * have to resort to stored procedures and BC4J/doDML. If I construct a DB View this is participating in an parent - child - grandChild - greatGrandChild relationship that are using dbSequence/dbTriggers, then BC4J should be smart enough to construct VO knowing that I want to do insert, update, delete, selects - based upon this structure.
Thanks Markus,
Bill G...
Maybe you are looking for
-
Sales order line items delivery cancelled but still appears in MD04.
Hi PP Gurus, In the sales there are 6 line items are there out of which for 1 line item delivery and PGI happened. And for remaining line items delivery got cancelled, but these line items for which delivery cancelled appearing in the MD04, I have re
-
DNL_CUST_PROD1 doesn't replicate product categories/ herarchies.
Hi Experts, When I run DNL_CUST_PROD1 it shows green in r3am1 but when I check tcode COMM_HIERARCHY , MAT_* is missing in R3PRODSTYP. On R/3 side, I don't see any categories or hierarchies in COMM_HIERARCHy tcode.Also in R/3 COMM_PRAPPLCAT is empt
-
IPod on iPhone is case sensitive with bandnames, iTunes is not
Hi, The iPod application on the iPhone (software version 3.1) is case sensitive with bandnames, iTunes (9.0.1) is not. iPod on iPhone shows the bands "Guns n' Roses" and "Guns N' Roses" as separate bands. iTunes manages them as one band. Cheers, Phil
-
Security feature in OBIEE when integrating Cubes from SAP BW
Situation: We are trying to integrate SAP BW cubes with OBIEE and create reports on OBIEE. We can import cubes and stuff into OBIEE and do the modelling to the multi dimensional db.. But when we talk about securities, we (in OBIEE side) want to do it
-
Barracuda 7200.11 1.5TB Internal Sata Drive
Hi Gang Looking for a few internal drives to use with the Rocket Sata 2310; This drive (particularly the 1TB version), had critical issues earlier this year. OWC informs me that they cleared up those issues. It seems to be priced lower (more affordab