HOW TO FIRE AN AFTERREPORT TRIGGER
Hi all,
I have an issue concerning executing an afterreport trigger. In my Data template, I put that trigger after the tag </dataQuery> and I have something like this:
</dataQuery>
<dataTrigger name="afterReport" source="XXEOC_AP_INVOICE_PRINT_pkg.XXEOC_print_invoice(:SUPPLIER_NAME,:SUPPLIER_SITE,:INVOICE_NUMBER,:INVOICE_DATE_FROM,:INVOICE_DATE_TO,:NEW_INVOICES)"/>
</dataTemplate>
That function is making an update on a table, but I want that the update to be done AFTER the report was executed....Now the trigger is executed before. Can anybody tell me how to put the trigger to be executed AFTER the report?
Thank you in advance.
Marius
You need to re-position after dataStructure section
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<dataTemplate name="dataTemplateName" description="Template description" defaultPackage="employee" version="1.0">
<parameters>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT EMPNO,ENAME,SAL
from EMP
WHERE DEPTNO = :P_DEPTNO ]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_EMP" source="Q1">
<element name="EMPLOYEE_NUMBER" value="EMPNO" />
<element name="NAME" value="ENAME"/>
<element name="SALARY" value="SAL"/>
</group>
</dataStructure>
<dataTrigger name="afterReport" source="EMPLOYEE.AfterReport" />
</dataTemplate>
Similar Messages
-
How to fire a schema trigger from outside the schema
A user is using an ad hoc tool similar to SQL Developer called PeopleSoft Application Designer.
He creates a connection to the db, then issues an alter session set current_schema = 'restricted_schema'. The connected user does not have direct privileges on the "restricted_schema" which they call SYSADM.
After changing the schema context in that manner he creates objects in SYSADM. A schema trigger is then fired and grants privileges on the new objects created in SYSADM. Doing the same in either SQL Plus or SQL Developer does not fire the schema trigger.
I think SQL Plus and SQL Dev are working as they should. Altering the session like that does not change your identity - just the schema context. But, when you examine v_$session, the connection with this other tool looks exactly the same as one from SQL Plus or SQL Dev when changing the schema context in the session.
Instead of trying to figure out what this other tool is doing, is there any way for that schema trigger to fire when using this process from one of our tools?>
A user is using an ad hoc tool similar to SQL Developer called PeopleSoft Application Designer.
He creates a connection to the db, then issues an alter session set current_schema = 'restricted_schema'. The connected user does not have direct privileges on the "restricted_schema" which they call SYSADM.
After changing the schema context in that manner he creates objects in SYSADM. A schema trigger is then fired and grants privileges on the new objects created in SYSADM. Doing the same in either SQL Plus or SQL Developer does not fire the schema trigger.
>
The user CANNOT create objects in any schema without the proper privileges.
Setting the current_schema parameter does not confer ANY additional privileges to a user. See ALTER SESSION in the SQL language doc
http://docs.oracle.com/cd/E14072_01/server.112/e10592/statements_2013.htm
>
CURRENT_SCHEMA
Syntax:
CURRENT_SCHEMA = schema
The CURRENT_SCHEMA parameter changes the current schema of the session to the specified schema. Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another ALTER SESSION SET CURRENT_SCHEMA statement.
This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name. This setting changes the current schema, but it does not change the session user or the current user, nor does it give the session user any additional system or object privileges for the session.
>
If the user connects and sets SYSADM as the current schema and creates objects in SYSADM the user already had privileges to create objects in the SYSADM schema; setting the current schema has nothing to do with it.
So your issue is that the user has privileges to create objects in the SYSADM schema; you need to revoke those privilges (or the role that grants them) to solve your problem. -
How to Fire Trigger, when changes are applied on destination??
Hi,
I want to fire the following trigger at destination, when changes are applied from source table (cms.test_2) to destination table(cms.test_2).
create or replace trigger Ins_and_upd
after insert or update of send_status on cms.test_2
declare
begin
update cms.test_2
set RECEIVE_STATUS = 'YES'
where UPPER(send_status)=upper('YES');
end;
Thanks,
faziarainI am using oracle10g stream replication, and database version is "10.2.0.1.0".
Basically I have 2 machines named:
--> Site#1_DB ----> Having Table TEST_2 -----> Columns (BID,DBID,Send_Status,Receive_Status,Final_Status).
--> Center_DB ----> Having Table TEST_2 -----> Columns (BID,DBID,Send_Status,Receive_Status,Final_Status).
My Senario example is following:
At Site#1_DB TEST_2 Table contains the following data:
TEST_2 is updating and set the YES value in "Send_Status" column, and this change will replicated to Center_DB TEST_2 table.
BID----------DBID----------Send_Status----------Receive_Status----------Final_Status
1----------2----------YES----------NULL----------NULL----------NULL
2----------3----------YES----------NULL----------NULL----------NULL
3----------4----------YES----------NULL----------NULL----------NULL
4----------5----------YES----------NULL----------NULL----------NULL
At Center_DB TEST_2 Table contains:
In My Senario changes are successfully replicated at Center_DB TEST_2 Table and after replication
Test_2 table is same on both machines.
But Now I want to write my given trigger at Center_DB and this trigger will be fired when changes are replicated
from Site#1_DB to Center_DB.
BID----------DBID----------Send_Status----------Receive_Status----------Final_Status
1----------2----------YES----------NULL----------NULL----------NULL
2----------3----------YES----------NULL----------NULL----------NULL
3----------4----------YES----------NULL----------NULL----------NULL
4----------5----------YES----------NULL----------NULL----------NULL
Output After Firing the trigger at Center_DB:
BID----------DBID----------Send_Status----------Receive_Status----------Final_Status
1----------2----------YES----------YES----------NULL----------NULL
2----------3----------YES----------YES----------NULL----------NULL
3----------4----------YES----------YES----------NULL----------NULL
4----------5----------YES----------YES----------NULL----------NULL
Thanks,
Faziarain.
Edited by: [email protected] on Mar 30, 2009 10:00 PM
Edited by: [email protected] on Mar 30, 2009 10:17 PM
Edited by: [email protected] on Mar 31, 2009 3:48 AM -
How to fire a trigger from java in oracle
Is it possible to fire/ call a trigger from java ? Is there any way ?
Sure.
Simply INSERT/DELETE/UPDATE your rows according to the trigger definition. -
How to fire event to generate insert message for the child objects?
We are in process to integrate CRM On Demand and existing Microsoft SQL DB.
We have the following problem:
For ex., we have CRM Object_1 that already synchronized with the SQL DB. CRM also has independent Object_2 and its child Object_2.1
We dicided that we want to connect the Object_2 as child to the Object_1.
The question is how to fire event to generate insert message for the Object_2 and Object_2.1?
What is the best technique? Is it possible to do it by workflow configuration or it needs to be done programmatically?
Thanks,
Dmitry
Edited by: 955827 on Aug 29, 2012 11:57 AMHi,
integration events can be generated only via worklow. You will need to create separate workflows for each record type (regardless if it is child or parent) because a workflow for the parent record type will not trigger when a child record is created/ associated. Also, the association workflows will trigger only when the specific event occurs.
There is not way to generate the integrtaion events programatically. They are generated by workflows and are read/ interpreted by a code extension. -
How to create a User Trigger?
This trigger must be fired every hour for a user called SCOTT. And inside this trigger I want to write in this way (Trigger is on SCOTT/TIGER@DB1):
connect scott/tiger@db2;
drop table EMP;
connect scott/tiger@db1;
copy form scott/tiger@db1 tp scott/tiger@db2 create EMP using select * from EMP;
How can I complete this trigger? Thank you.
nullyou can fire these statements using "DBMS_JOB". You can find more details in "Managing Jobs"
Cheers
r@m@ -
Open report file generated from AfterReport trigger fails
Hi,
I generate reports files using rwrun.exe.
In order to know if my report file has been generated without error, I call TEXT_IO.FOpen(..., 'r') into my afterreport to see if any file has been generated.
It works fine under win2000 but not under Solaris 5.8.
The report file is generated but for some strange reason TEXT_IO.FOpen( ) generates a non oracle exception -302000.
Any idea about what happens and how to fix that?
Thanks,
ManuHi Sripathy,
Thanks for your answer.
In the afterreport trigger, I just open my file as read only to see if it's there.
The process has just created the file, so, it should be able to open it just to read.
Anyway, I checked the rights on the file and they are Ok.
Actually, I think it's a problem with the OS because sometimes, it works fine and the next report, it fails.
Maybe the file is still "locked" by some other process as I try to read it.
That's a pain to not be able to check if the report went fine from the afterreport trigger.
Manu -
How to fire an event dynamically in JSF Page
Hi All
How to fire an event dynamically in JSF Page?
Thanks
SudhakarHi,
Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
In otherwords,
If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
Hope you understand
What is the role of MethodBinding mechanism here??
Thanks
Sudhakar Chavali -
How can i write the trigger for Global Temporary Table
Hi Grus,
How can i write the trigger for Global Temporary Table.
I was created the GTT with trigger using the below script .
CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
EMP_C_NAME VARCHAR2(20 BYTE)
ON COMMIT PRESERVE ROWS;
CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
BEFORE DELETE OR UPDATE OR INSERT
ON GLOBAL_TEMP
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
END;
trigger was create successfully, but the wouldn't insert into to EMPNAME Table..
Please guide whether am correct or not? if not kindly give a correct syntax with example
Thanks in Advance,
Arun M MBEGIN
INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
END;
you are referencing old value in insert stmt.
BEGIN
INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
END;then run ur application it works fine...
CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
EMP_C_NAME VARCHAR2(20 BYTE)
ON COMMIT PRESERVE ROWS;
CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
BEFORE DELETE OR UPDATE OR INSERT
ON GLOBAL_TEMP
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
dbms_output.put_line(:OLD.EMP_C_NAME||'yahoo');
INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
dbms_output.put_line(:OLD.EMP_C_NAME);
END;
create table EMPNAME as select * from GLOBAL_TEMP where 1=2
insert into GLOBAL_TEMP values('fgfdgd');
commit;
select * from GLOBAL_TEMP;
select * from EMPNAME;
output:
1 rows inserted
commit succeeded.
EMP_C_NAME
fgfdgd
1 rows selected
EMP_C_NAME
fgfdgd
1 rows selectedgot it Arun
Edited by: OraclePLSQL on Dec 28, 2010 6:07 PM -
How to create conditional update trigger in sql server
How to create conditional update trigger in sql server
You cant create a conditional update trigger. Once you create an update trigger it will get called for every update action. However you could write logic inside it to make it do your activity based on your condition using IF condition statement
Say for example if you've table with 6 columns and you want some logic to be implemented on update trigger only if col3 and col5 are participating in update operation you can write trigger like this
CREATE TRIGGER Trg_TableName_Upd
ON TableName
FOR UPDATE
AS
BEGIN
IF UPDATE(Col3) OR UPDATE (Col5)
BEGIN
....your actual logic here
END
END
UPDATE() function will check if column was involved in update operation and returns a boolean result
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Guys, How do I write a trigger to call Calulator /Notepad???
How do I write a trigger to call Calulator /Notepad???
how do i make a button to call the notepad editor in windows and calculator?
of course i know about making the button, i want the code behind the trigger....Kid, while you are providing more information on exactly what you are trying to do please make if clear if you are asking about a database table trigger or a Forms trigger?
As a general rule I would think an action such as calling a Windows specific feature should be done external to the database via the application.
HTH -- Mark D Powell -- -
AfterReport Trigger not working
Hi. My XML contains before and after report trigger. My beforeReport trigger works well but my afterReport trigger got problem. My afterReport trigger triggered before my dataStructure.
Below is my XMl sample.
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header: Vacancy Raised with Status Summary Report.xml 2010/11/12 Gunasilan Muniandy $-->
<dataTemplate name="Recruitment_Key_Performance_Indicators_Report" defaultPackage="MASIRC_KPI_REPORT_PKG" version="1.0">
<properties>
<property name="xml_tag_case" value="upper"/>
<property name="debug_mode" value="on"/>
</properties>
<parameters>
<parameter name="P_Vacancy_From" dataType="character" />
<parameter name="P_Vacancy_To" dataType="character" />
<parameter name="P_Report_Time" dataType="character" />
</parameters>
<dataTrigger name ="beforeReport" source="MASIRC_KPI_REPORT_PKG.CallProcedure(:P_Vacancy_From,:P_Vacancy_To,:P_Report_Time)"/>
<dataQuery>
<sqlStatement name="details">
<![CDATA[
SELECT
NO,
VAC_NAME,
RAS_APPROVE,
PUB_ST_DATE,
PUB_EN_DATE,
SHORLISTING,
INTERVIEW,
OFFER_ST_DT,
OFFER_EN_DT,
REPORT_DT
FROM MAS_IRC_KPI_TBL
where Report_dt =:P_Report_Time
ORDER BY VAC_NAME,no
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_1" dataType="varchar2" source="details">
<element name="VAC_NAME" dataType="varchar2" value="VAC_NAME" />
<element name="RAS_APPROVE" dataType="varchar2" value="RAS_APPROVE" />
<element name="PUB_ST_DATE" dataType="varchar2" value="PUB_ST_DATE" />
<element name="PUB_EN_DATE" dataType="varchar2" value="PUB_EN_DATE" />
<element name="SHORLISTING" dataType="varchar2" value="SHORLISTING" />
<element name="INTERVIEW" dataType="varchar2" value="INTERVIEW" />
<element name="OFFER_ST_DT" dataType="varchar2" value="OFFER_ST_DT" />
<element name="OFFER_EN_DT" dataType="varchar2" value="OFFER_EN_DT" />
</group>
</dataStructure>
<dataTrigger name ="afterReport" source="MASIRC_KPI_REPORT_PKG.CallProcedureDelete(:P_Report_Time)"/>
</dataTemplate>
please advice. thanks.try with naming the procedure afterreport......
-
How to fire two queries in one bean
When I am trying to fire two queries using statement and result set
it is showing error "result set is closed".
How to fire two queries?Just do it. The ResultSet should be the result of the query. So you're working on a wrong reference or something.
-
GlassPane: How to fire the ActionEvent of a JPanel
Hello Everyone,
I'm developing an application with a glasspane added to it. The idea is that some JPanels which act as an Button
can be "clicked" through the glasspane.The other components may not be clicked when the glasspane is enabled
When i click on the glasspane on a location where a JPanel is located, the correct Jpanel is found by getDeepestComponentAt (tested by using System.out).
but when i dispatch the event(mouseclick) on this JPanel the actionEvent isn't fired.
The JPanels are located in another class file then the glasspane is.
My question is how to fire a ActionEvent from another class?
Thanks in advance,If you post a SSCCE that demonstrates your problem, someone might be able to help.
{color:#0000ff}http://www.physci.org/codes/sscce.html{color}
db -
How to fire another event handler for postprocess stage
Hi All,
I have 3 custom event handlers for postprocess stage, for modify action on user object. The problem is tah only one event handler is executed - I use EntityManager API to modify user object. How to fire another event handlers? Do I have use UserManager API?
best
mpAs Bikash stated, used a single event handler. You can put if statements in there to identity the operation, as well as if statements if the parameter is found i the list of attributes being modified. This way you will only perform the action when necessary.
-Kevin
Maybe you are looking for
-
After running Adobe Download assistant I get a warning window.
It took all day to run the Adobe Download Assistant for Adobe CS6 Master Collection. When the .dmg finished downloading, up popped the warning window, "MasterCollection_CS6_invalid schecksum. I tried to open the .dmg from the folder to which I downlo
-
12vDC MacBook Pro Power Supply
Looking for a real 12vDC Power Supply for my 13" MBP 2.53GHz Core2Duo. (12v to 120vAC) "Inverter" NOT acceptable! Total waste of energy to go from 12vDC to 120vAC then back down to DC voltage as is supplied with OEM 60w AC supply... anyone know of a
-
"Close Project" to be made inactive until a particular phase is reached.
Hi All , I am having requirement of making "Close Project" under Document tab in Document toolbaras inactive until the Project reaches the final phase of it.what I thght of it is like locking/inactivating the "Close Project" by scripting when the pro
-
How to constant running a java application
I have created a java application. My main class is called PTS.class and that has my main method. I wish to run this class continously, such that each time the main method completes execution, it is called again. I could probably do that by creating
-
How can i share specific applications and files between laptops
I just bought a McBook Air and I would like to share specific applications and files between my old MacBook Pro and the nw MacBook Air.