Trigger not firing
Dear Oracle Guru's
We have four transaction tables in which we have triggers. whenever any changes like Insert,update,delete happens . the triggers Insert, update,delete another consolidated transactions Table. We found that on certain occurence , the triggers fail to fire i.e the consolidated transactions table do not get Inserted/updated/deleted. But we are not able to trace when the trigger fails.
Is there any Table or Storage that stores History of the trigger fires. Since this event happens very rarely we are unable to track it.
Kindly guide me in this regard
with warm regards
ssr
Is it a conditional trigger. Does it have a WHEN clause in the trigger statement?
Why dont you post your trigger so that people can have a look.
Similar Messages
-
WHEN-NEW-ITEM-INSTANCE TRIGGER NOT FIRING IN FORM PERSONLIZATION
We are upgrading to R12, when-new-item-instance trigger written for radio group not firing. using USO-821 Order Administrator Responsibility the function order capture.After clicking on actions push button
opening Copy Quote for this Form Personalization written.
For Radio Group Copy-Group when-new-item-instance trigger written but this trigger not firing,but In 11i Instance its Firing.
trigger-event: when-new-item-instance
Trigger-object:copy_group
condition:when copy_group='ALL'
Action: showing message.
The same when-new-instance trigger written in form item level and trigger execution hierarchy properties 'OVERRIDE'.
Just I am thinking this overriding by Item level trigger of form.
Please kindly help me quickly .What I need to do?
How can I make trigger to Fire?
Please kindly give solution.....Its very urgent Requirement.pls help me.
Regards,
BasavarajPlease kindly help me quickly .What I need to do?
> Please kindly give solution.....Its very urgent Requirement.pls help me.
Kindly log a SR for urgent issues.
Thanks,
Hussein -
WHEN-NEW-ITEM-INSTANCE TRIGGER NOT FIRING IN FORM PERSONLIZATION(R12 UPGRAD
We are upgrading to R12, when-new-item-instance trigger written for radio group not firing. using USO-821 Order Administrator Responsibility the function order capture.After clicking on actions push button
opening Copy Quote for this Form Personalization written.
For Radio Group Copy-Group when-new-item-instance trigger written but this trigger not firing,but In 11i Instance its Firing.
trigger-event: when-new-item-instance
Trigger-object:copy_group
condition:when copy_group='ALL'
Action: showing message.
The same when-new-instance trigger written in form item level and trigger execution hierarchy properties 'OVERRIDE'.
Just I am thinking this overriding by Item level trigger of form.
Please kindly help me quickly .What I need to do?
How can I make trigger to Fire?
Please kindly give solution.....Its very urgent Requirement.pls help me.
Regards,
BasavarajPlease kindly help me quickly .What I need to do?
> Please kindly give solution.....Its very urgent Requirement.pls help me.
Kindly log a SR for urgent issues.
Thanks,
Hussein -
Trigger not firing in linux OS
Hi All:
Initially i am developed a form using form builder and i deployed this form in Windows OS this is working fine when i am deploying this same form in Linux OS
that is not working even small trigger also not firing.so here we need to change any initial set up any help please.We are developing and deploying our Forms application on Linux, have no problem with the triggers whatsoever - any specific reason why developing on windows when deploying from Linux? otherwise, you have to recompile every time you move the form to the Linux iAS box for deployment (as Tony mentioned).
-
hi friends,
i have a trigger on key enter, but it is not firing when i press the enter key,
why it is not working. i want the trigger to be fired only if the user press Enter key
thanks
KrisHi Kris,
I would suggest you try searching this forum for "KEY-ENTER". You shall be able to find out why it does not fire
regards,
teo -
SPECIAL1 user defined Trigger not firing in Forms
Hi All forms Gurus,
I have a need of creating a menu under tools in forms and call another from from this new menu option.
I have done the below:
on my block I have written a PRE-BLOCK Trigger with the below code:
app_special.instantiate('SPECIAL1', 'Product Details');
app_special.ENABLE('SPECIAL1',PROPERTY_ON);
this is creating the menu option successfully on the forms at run time under TOOLS menu.
Next I have :
FND_FUNCTION.EXECUTE(FUNCTION_NAME => 'XXTEST'
,OTHER_PARAMS => ' P_PROD_CODE = ' || ''''|| :HOLDS_BLK.PROD_CODE
and this is not getting executed when I click on the "Product Details" new menu entry which is create above.
I even tried just putting
fnd_message.debug('from SPECIAL1'); to check if the SPECIAL1 Trigger is firing, removing the above FND_FUNTION.EXECUTE.
and I noticed that the SPECIAL! Trigger is not firing at all.
I would really appreciate if you can help me out in fixing this and making the SPECIAL1 trigger fire.
Thanks and Regards
RohitHi Rohit,
Welcome to OTN.
Since this is Apps issue, you might want to post it in the [E-Business Suites forum|http://forums.oracle.com/forums/category.jspa?categoryID=3].
-Arun -
SPECIAL1 user defined trigger not firing
Hi All forms Gurus,
I have a need of creating a menu under tools in forms and call another from from this new menu option.
I have done the below:
on my block I have written a PRE-BLOCK Trigger with the below code:
app_special.instantiate('SPECIAL1', 'Product Details');
app_special.ENABLE('SPECIAL1',PROPERTY_ON);
this is creating the menu option successfully on the forms at run time under TOOLS menu.
Next I have :
FND_FUNCTION.EXECUTE(FUNCTION_NAME => 'XXTEST'
,OTHER_PARAMS => ' P_PROD_CODE = ' || ''''|| :HOLDS_BLK.PROD_CODE
and this is not getting executed when I click on the "Product Details" new menu entry which is create above.
I even tried just putting
fnd_message.debug('from SPECIAL1'); to check if the SPECIAL1 Trigger is firing, removing the above FND_FUNTION.EXECUTE.
and I noticed that the SPECIAL! Trigger is not firing at all.
I would really appreciate if you can help me out in fixing this and making the SPECIAL1 trigger fire.
Thanks and Regards
Rohit and ZahirHi Rohit,
Welcome to OTN.
Since this is Apps issue, you might want to post it in the [E-Business Suites forum|http://forums.oracle.com/forums/category.jspa?categoryID=3].
-Arun -
Hi All,
I had created a Before and After Trigger for each row on a table.
The Before Trigger will be fired when some columns are updated.
In the Before trigger, I will changed the value of 1 column, says delvstatus.
The After trigger will be fired if the delvstatus was changed.
However, I noticed that after trigger is not fired if the delvstatus is changed within Before Trigger.
Is this a normal case for trigger execution in oracle?
Any comments are welcome.
Thanks.The before trigger and the after trigger should be fired like in the following test case.
If not please post your test case and your 4 digits Oracle version.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL>
SQL> drop table t purge;
Table dropped.
SQL> drop table log purge;
Table dropped.
SQL>
SQL> create table log(txt varchar2(50));
Table created.
SQL>
SQL> create table t (x int primary key, s1 int, s2 int);
Table created.
SQL>
SQL> create trigger tbu
2 before update of s1
3 on t
4 for each row
5 begin
6 :new.s1 := 1;
7 insert into log values('tbu fired');
8 end;
9 /
Trigger created.
SQL> show errors
No errors.
SQL>
SQL> create trigger tau
2 after update of s1
3 on t
4 for each row
5 begin
6 insert into log values('tau fired');
7 end;
8 /
Trigger created.
SQL> show errors
No errors.
SQL>
SQL> insert into t values(0,0,0);
1 row created.
SQL> update t set s1 = 2 where x = 0;
1 row updated.
SQL> select * from t ;
X S1 S2
0 1 0
SQL> select * from log;
TXT
tbu fired
tau fired
SQL> -
Why is this table trigger not firing when insert/update from servlet?
Hi!
I have this servlet that parses XML and stores values into Oracle tables. I have created a table trigger so that when one table is updated, a trigger is fired and the current system date is store in another table's field.
I have tested the trigger in Toad and it works, that is, if I update the table that the trigger is set to, the SYSDATE is stored as intended.
Here is the trigger's code:
DECLARE
tmpVar NUMBER;
NAME: transaction_time
PURPOSE:
REVISIONS:
Ver Date Author Description
1.0 9/14/2007 1. Created this trigger.
NOTES:
Automatically available Auto Replace Keywords:
Object Name: transaction_time
Sysdate: 9/14/2007
Date and Time: 9/14/2007, 8:00:42 AM, and 9/14/2007 8:00:42 AM
Username: (set in TOAD Options, Proc Templates)
Table Name: MS_RESLIMITS (set in the "New PL/SQL Object" dialog)
Trigger Options: (set in the "New PL/SQL Object" dialog)
BEGIN
tmpVar := 0;
UPDATE MS_Misc SET mi_lastrun = SYSDATE;
EXCEPTION
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END transaction_time;
Now, when the table is updated by the servlet, the trigger does not fire. And here is the code from the servlet:
--- <start of code> ---
boolean recordExists =
this.isRecordPresent("MS_ResLimits", "rl_compcode",
compCode, url);
Connection rlConn = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
rlConn = DriverManager.getConnection(url, dbUser,
dbPwd);
Statement stmt = rlConn.createStatement();
PreparedStatement xmlUpdate = null;
if (recordExists) {
xmlUpdate =
rlConn.prepareStatement("UPDATE MS_ResLimits SET rl_compcode = ?, rl_maxreslimit= ? WHERE rl_compcode =?");
xmlUpdate.setString(1, compCode);
xmlUpdate.setString(2, maximumReservationDate);
xmlUpdate.setString(3, compCode);
} else {
xmlUpdate =
rlConn.prepareStatement("INSERT INTO MS_ResLimits VALUES(?,?)");
xmlUpdate.setString(1, compCode);
xmlUpdate.setString(2, maximumReservationDate);
} //end-if-else
int n = xmlUpdate.executeUpdate();
rlConn.commit();
} catch (Exception ex) {
out.println(ex.toString() +
"-> error inserting Max Reservation Date<br>");
} finally {
if (rlConn != null) {
rlConn.close();
} //end-try-catch-finally
--- <end of code> ---
What causes the trigger to fire? the commit? My understanding is that executeUpdates are in autocommit mode by default, or am I mistaken? Do I have to programmatically send something to the DB so that the trigger fires?
BTW, I'm using JDeveloper 10.1.3.3.0. The project is being compiled with Java 1.5.0_06. The servlet is running in OCJ4 standalone. DB is 10g (don't know the release version).
...and, for some reason this message is not keeping format from my edit window to the post...
Thx!
Message was edited by:
delphosbean
Message was edited by:
delphosbean
Message was edited by:
delphosbeanYou are supposed to be able to preserve you formatting using the <pre></pre> tags but I can't get this to work either<br>
<br>
Patrick. -
Hi,
I am using Oracle 10G DS with Oracle 11G XE. I tried PRE-INSERT Trigger with the Code given by Mr Hamid. However, its not working. Though, the WHEN-NEW-ITEM-INSTANCE works fine, I wish to use PRE-INSERT Trigger only.
Can you please help me.
My Code is shown below
BEGIN
SELECT asset_id_seq.nextval INTO :r_it_blk.asset_id
FROM dual;
END;
Thanks in advance
RameshHi Hamid,
Thank you very much for your reply.
I tried at Block Level itself. Further, I also tried the below Code with Cursor (Block Level). Unfortunately, it is also not working. Even the Error Message is also not displayed. The User has full privileges.
DECLARE
CURSOR next_id IS SELECT asset_id_seq.NEXTVAL FROM dual;
BEGIN
OPEN next_id;
FETCH next_id INTO :r_it_blk.asset_id;
CLOSE next_id;
IF :r_it_blk.asset_id IS NULL THEN
Message('Error Generating Next Asset ID');
RAISE Form_Trigger_Failure;
END IF;
END;
Regards
Ramesh -
BeforeReport trigger not firing
I'm sure I'm just not using this right, but I can't for the life of me figure out how to get a simple beforeReport trigger to fire. I've created a function that just inserts in to a test table to see if it's working, and then returns a true. I've set up the following data structure to test it out:
<dataTemplate name="Test" description="ITest" Version="1.0">
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT sysdate FROM dual]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReport" source="apps.es_test.test_function()"/>
</dataTemplate>
I get the sysdate just fine, but I never see any data in the test field. I'm mainly interested in setting the ORG ID (which I saw the Blog post on), but if I can't even get a test to work, I figure I must be missing a step somewhere. Any ideas? Is there somewhere else I have to tell it to use a trigger?
EDIT: Had a typo in the source of the trigger. Fixed, but not working still.
Message was edited by:
FrijolesJust a followup to my own thread... does this program not even alert you if the trigger being called has issues? I can put source="something_that_doesnt_exist()" and it will happily run the main query without any messages are warnings, even with debug turned on (which doesn't seem to do anything anyway).
I think I'm getting frustrated with this program. Anyone know if Metalink is the correct avenue to find real support and not just this forum? -
Before Report Trigger Not Firing
Hi Trying to Fire before report trigger in this piece of code, Calling in on XML Publisher 5.6.3 and running on XDODTEXE
The function its calling is a boolean... Can anyone see a problem with the xml calling the function....
<?xml version = '1.0' encoding = 'UTF-8'?>
<dataTemplate name="EXPENSES" defaultpackage="OO_HR_OO_GENERAL" version="1.0">
<parameters>
<parameter name="P_VACANCY_ID" dataType = "number" defaultValue=""></parameter>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT
PPD.SEGMENT16 UPN
,(SELECT meaning
FROM fnd_lookup_values
WHERE lookup_type = 'NR_REORG_NAME'
AND lookup_code = pos.attribute21) RE_ORG_NAME
,pv.name VACANCY_NAME
,HR_GENERAL.DECODE_JOB(PV.JOB_ID) JOB_NAME
,HR_GENERAL.DECODE_ORGANIZATION(PV.ORGANIZATION_ID) DEPT
,PANEL_MEMBERS.PANEL_MEMBER
,PANEL_MEMBERS.PANEL_START_TIME
,PANEL_MEMBERS.PANEL_START_DATE
,PANEL_MEMBERS.INTERVIEW_LOC
from hr_all_positions_f POS,
per_position_definitions PPD,
PER_ALL_VACANCIES PV,
(SELECT prec2.attribute4 PANEL_MEMBER
,prec2.attribute2 PANEL_START_TIME
,to_char(fnd_date.canonical_to_date(prec2.attribute1),'DD-MON-YYYY') PANEL_START_DATE
,hr_general.decode_location(prec2.attribute3) INTERVIEW_LOC
,PREC1.VACANCY_ID
FROM
PER_RECRUITMENT_ACTIVITY_FOR PREC1,
per_recruitment_activities PREC2
WHERE PREC1.RECRUITMENT_ACTIVITY_ID = PREC2.RECRUITMENT_ACTIVITY_ID
and sysdate between prec2.date_start and nvl(sysdate,prec2.date_end)
and prec2.date_start = (select max(prec3.date_start)
from per_recruitment_activities prec3,
PER_RECRUITMENT_ACTIVITY_FOR prec4
where prec3.RECRUITMENT_ACTIVITY_ID = prec4.RECRUITMENT_ACTIVITY_ID
and prec3.attribute4 is not null
and PREC4.VACANCY_ID = PREC1.VACANCY_ID)) PANEL_MEMBERS
where sysdate between pos.effective_start_date and pos.effective_end_date
and pos.status = 'VALID'
and ppd.position_definition_id = pos.position_definition_id
and pv.position_id = pos.position_id
and pv.vacancy_id = panel_members.vacancy_id(+)
AND PV.VACANCY_ID = :P_VACANCY_ID]]>
</sqlStatement>
<sqlStatement name="Q2">
<![CDATA[SELECT pos.name position_name
,PPD.SEGMENT16 UPN
,PPD.SEGMENT17 FUNCTION
,PPD.SEGMENT18 ROUTE
,PPD.SEGMENT19 DELIVERY_UNIT
,(select FVT.DESCRIPTION
from fnd_flex_value_SETS fvs,
fnd_flex_values fv,
fnd_flex_values_tl fvt
WHERE fvs.flex_value_set_name = 'NR_Safety_Critical_Indicator'
AND fv.flex_value_set_id = fvs.flex_value_set_id
and fv.flex_value_id = fvt.flex_value_id
AND fvt.LANGUAGE = USERENV ('LANG')
and fv.flex_value = POS.ATTRIBUTE2) SAFETY_INDICATOR
,pv.name vacancy_name
,PV.VACANCY_ID
,HR_GENERAL.DECODE_GRADE(PV.GRADE_ID) VACANCY_GRADE
,HR_GENERAL.DECODE_JOB(PV.JOB_ID) Job_name
,APL.LAST_NAME
,APL.FIRST_NAME
,APL.EMP_APL_NUMBER
,APL.EMP_GRADE
,APL.re_org_status
from hr_all_positions_f POS,
per_position_definitions PPD,
PER_ALL_VACANCIES PV,
(SELECT pv.vacancy_id
,PPF.LAST_NAME
,PPF.FIRST_NAME
,NVL(PPF.APPLICANT_NUMBER,EMPLOYEE_NUMBER) EMP_APL_NUMBER
,HR_GENERAL.DECODE_GRADE((SELECT PAF2.GRADE_ID
FROM PER_ALL_ASSIGNMENTS_F PAF2
WHERE PAF2.PERSON_ID = PAF1.PERSON_ID
AND PAF2.ASSIGNMENT_TYPE = 'E'
AND SYSDATE BETWEEN PAF2.EFFECTIVE_START_DATE AND PAF2.EFFECTIVE_END_DATE
AND ROWNUM = 1)) EMP_GRADE
,(SELECT fl.meaning REORG_STATUS
FROM apps.per_person_analyses ppa,
apps.per_analysis_criteria pac,
apps.per_special_info_types_v psi,
fnd_lookup_values FL
WHERE ppa.id_flex_num = pac.id_flex_num
AND ppa.analysis_criteria_id = pac.analysis_criteria_id
AND psi.id_flex_num = ppa.id_flex_num
AND psi.NAME = 'Re-Organisation Details'
and fl.lookup_type = 'NR_REORG_APPSTATUS'
and fl.lookup_code = pac.segment2
and ppa.person_id = ppf.person_id
and rownum = 1) re_org_status
FROM PER_ALL_ASSIGNMENTS_F PAF1,
PER_ALL_PEOPLE_F PPF,
PER_ALL_VACANCIES PV
WHERE PAF1.ASSIGNMENT_TYPE = 'A'
AND SYSDATE BETWEEN PAF1.EFFECTIVE_START_DATE AND PAF1.EFFECTIVE_END_DATE
AND SYSDATE BETWEEN PPF.EFFECTIVE_START_DATE AND PPF.EFFECTIVE_END_DATE
AND PAF1.PERSON_ID = PPF.PERSON_ID
AND PAF1.VACANCY_ID = PV.VACANCY_ID) apl
where sysdate between pos.effective_start_date and pos.effective_end_date
and pos.status = 'VALID'
and ppd.position_definition_id = pos.position_definition_id
and pv.position_id = pos.position_id
and pv.vacancy_id = apl.vacancy_id(+)
AND PV.VACANCY_ID = :P_VACANCY_ID]]>
</sqlStatement>
<sqlStatement name="Q3">
<![CDATA[SELECT (SELECT ppf2.first_name||' '||PPF2.Last_name||', '||ppf2.employee_number||', '||ppd2.segment17||', '||ppd2.segment18||', '||ppd2.segment19 employee_number
FROM PER_ALL_ASSIGNMENTS_F PAF2,
PER_ALL_PEOPLE_F PPF2,
HR_ALL_POSITIONS_F POS2,
PER_POSITION_DEFINITIONS PPD2
WHERE PAF2.PERSON_ID = PPF2.PERSON_ID
AND PAF2.POSITION_ID = POS2.POSITION_ID
and ppd2.position_definition_id = pos2.position_definition_id
AND SYSDATE BETWEEN ppf2.effective_start_date AND ppf2.effective_end_date
AND SYSDATE BETWEEN paf2.effective_start_date AND paf2.effective_end_date
AND SYSDATE BETWEEN pos2.effective_start_date AND pos2.effective_end_date
AND PAF2.ASSIGNMENT_TYPE = 'E'
AND PAF2.PERSON_ID = PAF.PERSON_ID) employee_number,
pos.NAME "CURRENT_POS",
PAF.PERSON_ID,
XXNR_HR_COPP_GENERAL.VAC_NAME(pac.segment3)||' - ' "VAC_PREF1",
XXNR_HR_COPP_GENERAL.VAC_POS(pac.segment3) "VAC_PREF1_POS_NAME",
XXNR_HR_COPP_GENERAL.VAC_NAME(pac.segment4)||' - ' "VAC_PREF2",
XXNR_HR_COPP_GENERAL.VAC_POS(pac.segment4) "VAC_PREF2_POS_NAME",
XXNR_HR_COPP_GENERAL.VAC_NAME(pac.segment5)||' - ' "VAC_PREF3",
XXNR_HR_COPP_GENERAL.VAC_POS(pac.segment5) "VAC_PREF3_POS_NAME",
(SELECT LOCATION_CODE
FROM HR_LOCATIONS WHERE LOCATION_ID = pac.segment15
AND ROWNUM = 1) "REORG_ADMIN_OFFICE",
(SELECT LOCATION_CODE
FROM HR_LOCATIONS WHERE LOCATION_ID = pac.segment18
AND ROWNUM = 1) "PREF_LOCATION",
pac.segment19 "WILL_RELOCATE",
pac.segment20 "LOCATION_TO_RELOCATE"
FROM apps.per_people_f ppf,
apps.per_assignments_f paf,
apps.hr_all_positions_f pos,
apps.per_person_analyses ppa,
apps.per_analysis_criteria pac,
apps.per_special_info_types_v psi,
apps.per_vacancies pv
WHERE ppf.person_id = ppa.person_id
AND SYSDATE BETWEEN ppf.effective_start_date AND ppf.effective_end_date
AND SYSDATE BETWEEN paf.effective_start_date AND paf.effective_end_date
AND SYSDATE BETWEEN pos.effective_start_date AND pos.effective_end_date
AND ppf.person_id = paf.person_id
and paf.vacancy_id = pv.vacancy_id
AND paf.position_id = pos.position_id
AND pos.status = 'VALID'
AND paf.assignment_type = 'A'
AND ppa.id_flex_num = pac.id_flex_num
AND ppa.analysis_criteria_id = pac.analysis_criteria_id
AND psi.id_flex_num = ppa.id_flex_num
AND psi.NAME = 'Re-Organisation Details'
AND PV.VACANCY_ID = :P_VACANCY_ID]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReport" source="OO_HR_OO_GENERAL.submit_request_22(:P_VACANCY_ID)"/>
<dataStructure>
<group name="PANEL_MEM_LIST" source="Q1">
<element name="PANEL_MEMBER" value ="PANEL_MEMBER"/>
<element name="PANEL_START_TIME" value ="PANEL_START_TIME"/>
<element name="INTERVIEW_LOC" value ="INTERVIEW_LOC"/>
<element name="PANEL_START_DATE" value ="PANEL_START_DATE"/>
<element name="UPN" value ="UPN"/>
<element name="RE_ORG_NAME" value ="RE_ORG_NAME"/>
<element name="VACANCY_NAME" value ="VACANCY_NAME"/>
<element name="JOB_NAME" value ="JOB_NAME"/>
<element name="DEPT" value ="DEPT"/>
</group>
<group name="LIST_OF_EMPS" source = "Q2">
<element name="POSITION_NAME" value ="POSITION_NAME"/>
<element name="UPN" value ="UPN"/>
<element name="VACANCY_GRADE" value ="VACANCY_GRADE"/>
<element name="FUNCTION" value ="FUNCTION"/>
<element name="ROUTE" value ="ROUTE"/>
<element name="DELIVERY_UNIT" value ="DELIVERY_UNIT"/>
<element name="SAFETY_INDICATOR" value ="SAFETY_INDICATOR"/>
<element name="VACANCY_NAME" value ="VACANCY_NAME"/>
<element name="VACANCY_ID" value ="VACANCY_ID"/>
<element name="JOB_NAME" value ="JOB_NAME"/>
<element name="LAST_NAME" value ="LAST_NAME"/>
<element name="FIRST_NAME" value ="FIRST_NAME"/>
<element name="EMP_APL_NUMBER" value ="EMP_APL_NUMBER"/>
<element name="EMP_GRADE" value ="EMP_GRADE"/>
<element name="RE_ORG_STATUS" value ="RE_ORG_STATUS"/>
<element name="EMP_GRADE" value ="EMP_GRADE"/>
<element name="RE_ORG_STATUS" value ="RE_ORG_STATUS"/>
</group>
<group name="LIST_OF_EMPS_PREFS" source = "Q3">
<element name="EMPLOYEE_NUMBER" value ="EMPLOYEE_NUMBER"/>
<element name="CURRENT_POS" value ="CURRENT_POS"/>
<element name="VAC_PREF1_POS_NAME" value ="VAC_PREF1_POS_NAME"/>
<element name="VAC_PREF2_POS_NAME" value ="VAC_PREF2_POS_NAME"/>
<element name="VAC_PREF3_POS_NAME" value ="VAC_PREF3_POS_NAME"/>
<element name="VAC_PREF1" value ="VAC_PREF1"/>
<element name="VAC_PREF2" value ="VAC_PREF2"/>
<element name="VAC_PREF3" value ="VAC_PREF3"/>
<element name="REORG_ADMIN_OFFICE" value ="REORG_ADMIN_OFFICE"/>
<element name="PREF_LOCATION" value ="PREF_LOCATION"/>
<element name="WILL_RELOCATE" value ="WILL_RELOCATE"/>
<element name="LOCATION_TO_RELOCATE" value ="LOCATION_TO_RELOCATE"/>
</group>
</dataStructure>
</dataTemplate>
Edited by: Sharky on Jun 23, 2009 5:02 AMRules-wise, you have the beforeReport trigger before the dataStructure, and that is correct. Syntax, the parameter is going in okay. Question is then the logic or data. Does the function work outside of this? That is, if you were to exec the function in an anonymous block of PL/SQL, do you get the desired output (i.e., test for boolean value returned)?
-
When-window-activated trigger not firing
Hi,
I got this scenario :
Opens a form, the When-new-form-instance runs, the When-window-activated runs.
But if a message is shown in the when-new-form-instance trigger, the when-window-activated wont run.
Anybody whos got a solution for this, as I need the trigger to run.
regards
KimIt can be very simple as :
plib_do_something_1;
plib_do_something_2;
message('Show a message on the screen');
do_key('Enter_query');
The thing is that its only if the message is showed as pop-up the problem exists. If I remove the 'do_key('enter_query')', the message is showed at the statusbar and the wwa trigger fires. -
Schema Trigger not firing except for the schema's user
Hi. I've created this schema level trigger. The schema is TTMS and the user I created the trigger with is named TTMS. The trigger is designed to alert me by email when someone alters a schema object.
My problem is that the trigger only fires when I'm logged in as the schema owner (TTMS). When I'm logged in as TTMS and add a column to a table in this schema I get the email alert as expected. But if I log in as my own individual username (SSBUECHL) the trigger doesn't fire.
Is there a privilege that the TTMS user needs to grant to my user so that this trigger will fire when I'm logged in as SSBUECHL? Any help would be greatly appreciated.
CREATE OR REPLACE TRIGGER TTMS.altered_ttms_tabs_trigger
AFTER ALTER ON ttms.SCHEMA
DECLARE
PSENDER VARCHAR2(200);
PRECIPIENT VARCHAR2(200);
P_CC_RECIPIENT VARCHAR2(200);
P_BCC_RECIPIENT VARCHAR2(200);
PSUBJECT VARCHAR2(200);
PMESSAGE VARCHAR2(6000);
auditTable_ind varchar2(1);
BEGIN
select nvl(count(table_name),0)
into auditTable_ind
from all_triggers
where substr(trigger_name,1,9) = upper('tr_audit#')
and table_name=ora_dict_obj_name;
if auditTable_ind > 0 then
INSERT INTO altered_tabs
VALUES
(ora_dict_obj_type, ora_dict_obj_name, SYSDATE, user);
PSENDER := '[email protected]';
PRECIPIENT := '[email protected]';
P_CC_RECIPIENT := '[email protected]';
P_BCC_RECIPIENT := '[email protected]';
PSUBJECT := 'TTMS Audit - Altered Audit Table Alert - Action Required';
PMESSAGE := ora_dict_obj_name||' was altered on '||sysdate||' by '||user||'. Please rebuild the audit index immediately.';
TTMS.SEND_MAIL ( PSENDER, PRECIPIENT, P_CC_RECIPIENT, P_BCC_RECIPIENT, PSUBJECT, PMESSAGE );
end if;
END;
/No, but I've alter the code as such and it still only fires for the TTMS user:
CREATE OR REPLACE TRIGGER TTMS.altered_ttms_tabs_trigger
AFTER ALTER ON ttms.SCHEMA
DECLARE
PSENDER VARCHAR2(200);
PRECIPIENT VARCHAR2(200);
P_CC_RECIPIENT VARCHAR2(200);
P_BCC_RECIPIENT VARCHAR2(200);
PSUBJECT VARCHAR2(200);
PMESSAGE VARCHAR2(6000);
auditTable_ind varchar2(1);
BEGIN
select nvl(count(table_name),0)
into auditTable_ind
from all_triggers
where substr(trigger_name,1,9) = upper('tr_audit#')
and table_name=ora_dict_obj_name;
if auditTable_ind > 0 then
*/ INSERT INTO altered_tabs
VALUES
(ora_dict_obj_type, ora_dict_obj_name, SYSDATE, user);
PSENDER := '[email protected]';
PRECIPIENT := '[email protected]';
P_CC_RECIPIENT := '[email protected]';
P_BCC_RECIPIENT := '[email protected]';
PSUBJECT := 'TTMS Audit - Altered Audit Table Alert - Action Required';
PMESSAGE := ora_dict_obj_name||' was altered on '||sysdate||' by '||user||'. Please rebuild the audit index immediately.';
TTMS.SEND_MAIL ( PSENDER, PRECIPIENT, P_CC_RECIPIENT, P_BCC_RECIPIENT, PSUBJECT, PMESSAGE );
-- end if;
END;
/Edited by: sharpe on Jun 9, 2011 3:39 PM -
Trigger not behaving as expected
I have the following trigger on my table. I want to log in records which fail to insert into my main table RTS_EXCEL_UPLOAD into my audit table RTS_EXCEL_UPLOAD_BK. However, when I try to insert a bad record into my main table it throws an exception but does not log the record into RTS_EXCEL_UPLOAD_BK.
CREATE OR REPLACE TRIGGER TRG_RTS_EXCEL_UPLOAD_BF_I
BEFORE INSERT ON RTS_EXCEL_UPLOAD
FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO RTS_EXCEL_UPLOAD_BK
(LG_NAME,LG_CODE,PRODUCT_CODE,RTS_PERCENTAGE,LAST_UPDATE_DATE,LAST_UPDATE_USER,COUNTRY_ID)
VALUES
(:new.LG_NAME,:new.LG_CODE,:new.PRODUCT_CODE,:new.RTS_PERCENTAGE,:new.LAST_UPDATE_DATE,:new.LAST_UPDATE_USER,:new.COUNTRY_ID)
DBMS_OUTPUT.PUT_LINE('TRIGGER FIRED');
COMMIT;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('TRIGGER NOT FIRED');
END;
CREATE TABLE RTS_EXCEL_UPLOAD_BK
(LG_NAME VARCHAR2(256)
,LG_CODE VARCHAR2(256)
,PRODUCT_CODE VARCHAR2(256)
,RTS_PERCENTAGE VARCHAR2(256)
,LAST_UPDATE_DATE VARCHAR2(256)
,LAST_UPDATE_USER VARCHAR2(256)
,COUNTRY_ID VARCHAR2(256));
CREATE TABLE RTS_EXCEL_UPLOAD
((LG_NAME VARCHAR2(256)
,LG_CODE NUMBER
,PRODUCT_CODE VARCHAR2(256)
,RTS_PERCENTAGE VARCHAR2(256)
,LAST_UPDATE_DATE VARCHAR2(256)
,LAST_UPDATE_USER VARCHAR2(256)
,COUNTRY_ID VARCHAR2(256));
INSERT INTO RTS_EXCEL_UPLOAD (LG_CODE)VALUES('A1');
this is not inserting record into my audit table RTS_EXCEL_UPLOAD_BK as expected.Hi,
You can use FORALL SAVE EXCEPTIONS to audit in your backup table.
Let us see the example below :
create table test_tab
col1 number,
col2 varchar2(20),
constraint test_tab_ck check ( col1 in (1,2,3))
create table test_tab_bk
col1 number,
col2 varchar2(20)
SET serveroutput ON
DECLARE
CURSOR cur_insert
IS
SELECT
ROUND(dbms_random.value(1,4)) AS col1,
'#######' AS col2
FROM
dual
CONNECT BY level <= 10;
TYPE rec_insert_tbl IS TABLE OF cur_insert%ROWTYPE INDEX BY PLS_INTEGER;
insert_tbl rec_insert_tbl;
/* Exceptions */
dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(dml_errors, -24381);
/*Variables*/
w_error_count NUMBER;
BEGIN
OPEN cur_insert;
FETCH cur_insert bulk collect INTO insert_tbl;
BEGIN
FORALL idx IN insert_tbl.FIRST .. insert_tbl.LAST SAVE EXCEPTIONS
INSERT
INTO
test_tab
col1,
col2
VALUES
insert_tbl(idx).col1,
insert_tbl(idx).col2
EXCEPTION
WHEN dml_errors THEN
w_error_count := SQL%BULK_EXCEPTIONS.count;
FOR i IN 1 .. w_error_count
LOOP
dbms_output.put_line ( 'Error: ' || i || ' Array Index: ' || SQL%BULK_EXCEPTIONS(i).error_index
|| ' Message: ' || SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE) ) ;
/* Again looping through the data which is to inserted */
FOR idx IN insert_tbl.FIRST .. insert_tbl.LAST
LOOP
/* If the index of the cursor is same as error index, insert in the Backup table */
IF idx = SQL%BULK_EXCEPTIONS(i).error_index THEN
INSERT
INTO
test_tab_bk
col1,
col2
VALUES
insert_tbl(idx).col1,
insert_tbl(idx).col2
END IF;
END LOOP;
END LOOP;
END;
CLOSE cur_insert;
commit;
END;
select * from test_tab;
select * from test_tab_bk;This will work, but not sure if it can be implemented in your code.
This solution is also not great performance wise as for backup table we are inserting row by row.
LOG ERRORS INTO is still the best solution(both in usability and performance wise) and if possible try to use it.
Maybe you are looking for
-
App Store does not show download status.
Hi There, in need a bit of help.. apparently, the App store on my macbook pro does not sure any download status for the apps i download. However, i do see a growing bar on my dock for the app i am downloading. Is there any way i can get it to show?
-
Minutes Delivery when exactly?
After reading the Mod posts I and sifting through the almost endless posts my question remains unanswered. So.... When are the minutes for my fixed rate 120 minutes to England being delivered? I know they are delievered monthly...Today ( the 16th) is
-
Fireworks CS3 question: Photoshop lets you convert an image from RGB to CMYK to etc... Can you do that in FW? Alec Adobe Community Expert
-
Indian language file - pdf problem
I work mostly with Indian langauges fonts and have ttf (and some ATM) fonts. When I try to make pdf for printing purposes, some characters do not appear in pdf. I found from the character map that they are equivalent to "no-break space" character. An
-
Can't install itunes or quicktime
So today I found out that I needed to update quicktime so I did, but it was taking 45 minutes to install quicktime so I stopped the installation. Now I can't open up itunes and when I try to reinstall itunes it says: "1607: Unable to installSheild Sc