...trigger issssue urgent
table cell
cell_id bscid
cellA bsc1
cellB bsc2
cellC bsc1
cellD bsc1
cellE bsc3
table irc
cell_id bsc
cellC ----
Now user will insert record in the table irc , and i want that bsc column should be filled automaticaly as user may not remember each cell's bsc..
following is the triiger i wrote
create or replace trigger T1
after insert on irc
for each row
declare
vbsc varchar2(10);
begin
select cell.bscid into vbsc from cell where cell.cell_id = irc.cell_id;
insert into irc ( bsc) values ( vbsc);
end;
THIS IS NOT WORKING AT ALL SHOWING ME A MESSAGE THAT
table of view does not exist.
THE Table do exist in USER A's table ..
i dont know what is happening..
kindly reply urgent
ALL I want is that wheneve user INSERT any row in IRC table .,
HE should not be allowed to insert BSCID , instead BSC ID should come up from a join and automatically fills in ..
thnx alot
regards
Look at this:SQL>CREATE TABLE cell
2 (
3 cell_id CHAR(5 CHAR),
4 bscid CHAR(4 CHAR)
5 );
Table created.
SQL>CREATE TABLE irc
2 (
3 cell_id CHAR(5 CHAR),
4 bsc CHAR(4 CHAR)
5 );
Table created.
SQL>INSERT INTO cell VALUES ('cellA' ,'bsc1');
1 row created.
SQL>INSERT INTO cell VALUES ('cellB' ,'bsc2');
1 row created.
SQL>INSERT INTO cell VALUES ('cellC' ,'bsc1');
1 row created.
SQL>INSERT INTO cell VALUES ('cellD' ,'bsc1');
1 row created.
SQL>INSERT INTO cell VALUES ('cellE' ,'bsc3');
1 row created.
SQL>COMMIT;
Commit complete.
SQL>SELECT * FROM cell;
CELL_ BSCI
cellA bsc1
cellB bsc2
cellC bsc1
cellD bsc1
cellE bsc3
SQL>CREATE OR REPLACE TRIGGER irc_trg
2 BEFORE INSERT ON irc
3 FOR EACH ROW
4 BEGIN
5 SELECT bscid INTO :NEW.bsc FROM cell WHERE cell_id=:NEW.cell_id;
6 END;
7 /
Trigger created.
SQL>INSERT INTO irc (cell_id) VALUES ('cellA');
1 row created.
SQL>COMMIT;
Commit complete.
SQL>SELECT * FROM irc;
CELL_ BSC
cellA bsc1Isn't it what you need?
Yoann.
Similar Messages
-
Need help in writin a trigger---Very Urgent
Help me in creating the trigger with below specifications.
"We want to reject record deletions where DATE_APPROVED_PROV is not null or NLA_PROV_DONE is not null
We want to reject updates where (DATE_APPROVED_PROV is not null or NLA_PROV_DONE is not null)
and
(any of CAPEX or RFS or ALLOCATIONS or DEPR_START_DATE is different before update than it would be after update)"
Defination of Table is below :
CREATE TABLE ir_data
(record_id NUMBER(12,0) NOT NULL,
request_title VARCHAR2(255),
cio VARCHAR2(30),
host_country VARCHAR2(20),
ben_project_name VARCHAR2(255),
application VARCHAR2(80),
req_summary VARCHAR2(500),
external_ref VARCHAR2(255),
submitted_by VARCHAR2(60),
approved_by_prov VARCHAR2(60),
date_approved_prov DATE,
approved_by_final VARCHAR2(60),
date_approved_final DATE,
nla_prov_done DATE,
nla_final_done DATE,
cost_alloc_method VARCHAR2(255),
capex NUMBER(12,0) DEFAULT 0,
allocations NUMBER(12,0) DEFAULT 0,
rfs NUMBER(12,0) DEFAULT 0,
ben_budget_id VARCHAR2(20),
delete_flag VARCHAR2(1),
amortisation NUMBER(12,0) DEFAULT 0
depr_start_date DATE,
fy_allocations NUMBER(12,0),
wusys VARCHAR2(1))Help me in creating the trigger with below
specifications.
"We want to reject record deletions where
DATE_APPROVED_PROV is not null or NLA_PROV_DONE is
not null
We want to reject updates where (DATE_APPROVED_PROV
is not null or NLA_PROV_DONE is not null)
and
(any of CAPEX or RFS or ALLOCATIONS or
DEPR_START_DATE is different before update than it
would be after update)"
Defination of Table is below :
CREATE TABLE ir_data
(record_id NUMBER(12,0) NOT
NULL,
request_title VARCHAR2(255),
cio VARCHAR2(30),
host_country VARCHAR2(20),
ben_project_name VARCHAR2(255),
application VARCHAR2(80),
req_summary VARCHAR2(500),
external_ref VARCHAR2(255),
submitted_by VARCHAR2(60),
approved_by_prov VARCHAR2(60),
date_approved_prov DATE,
approved_by_final VARCHAR2(60),
date_approved_final DATE,
nla_prov_done DATE,
nla_final_done DATE,
cost_alloc_method VARCHAR2(255),
capex NUMBER(12,0) DEFAULT
0,
allocations NUMBER(12,0)
DEFAULT 0,
rfs NUMBER(12,0)
DEFAULT 0,
ben_budget_id VARCHAR2(20),
delete_flag VARCHAR2(1),
amortisation NUMBER(12,0)
DEFAULT 0
depr_start_date DATE,
fy_allocations NUMBER(12,0),
wusys VARCHAR2(1))(any of CAPEX or RFS or ALLOCATIONS or DEPR_START_DATE is different before update than it would be after update)
I think if any of these change during an update do something. Not sure what. Probably reject, because that is what the other 2 requirements are.
Is this for an homework assignment?
Jim P. -
Error while using Before report trigger. -- Urgent
Dear All,
The following error I am getting when I execute my data template where I have used Before Report Trigger. I am also pasting the Data Template that I have developed.
============================
Error
============================
XDO Data Engine Version No: 5.6.3
Resp: 20560
Org ID : 204
Request ID: 4846248
All Parameters: P_LOB=01:P_DIV_FROM=:P_DIV_TO=:P_FROM_ORG=:P_TO_ORG=:P_INV_FROM=:P_TO_INV=:P_TRX_DATE_FROM="2003/01/01 00:00:00":P_TRX_DATE_TO="2003/01/15 00:00:00"
Data Template Code: SSBWIPANA_MFGR
Data Template Application Short Name: WIP
Debug Flag: N
{P_DIV_FROM=, P_TRX_DATE_TO=2003/01/15 00:00:00, P_DIV_TO=, P_FROM_ORG=, P_TO_ORG=, P_TRX_DATE_FROM=2003/01/01 00:00:00, P_INV_FROM=, P_LOB=01, P_TO_INV=}
Calling XDO Data Engine...
[122407_011745100][][EXCEPTION] SQLException encounter while executing data trigger....
java.sql.SQLException: ORA-06550: line 2, column 12:
PLS-00302: component 'P_LOB' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
ORA-06550: line 3, column 12:
PLS-00302: component 'P_DIV_FROM' must be declared
ORA-06550: line 3, column 1:
PL/SQL: Statement ignored
ORA-06550: line 4, column 12:
PLS-00302: component 'P_DIV_TO' must be declared
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored
ORA-06550: line 5, column 12:
PLS-00302: component 'P_FROM_ORG' must be declared
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored
ORA-06550: line 6, column 12:
PLS-00302: component 'P_TO_ORG' must be declared
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored
ORA-06550: line 7, column 12:
PLS-00302: component 'P_FROM_INV' must be declared
ORA-06550: line 7, column 1:
PL/SQL: Statement ignored
ORA-06550: line 8, column 12:
PLS-00302: component 'P_TO_INV' must be declared
ORA-06550: line 8, column 1:
PL/SQL: Statement ignored
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:967)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3327)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3433)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394)
at oracle.apps.xdo.dataengine.XMLPGEN.executeTriggers(XMLPGEN.java:699)
at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:254)
at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:205)
at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:237)
at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:364)
at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:236)
at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
=====================================================
Data Template
====================================================
<dataTemplate name="SSBWIPANA_MFGR" defaultPackage="PRODUCTION" version="1.0">
<parameters>
<parameter name="P_LOB" datatype="charecter"/>
<parameter name="P_DIV_FROM" datatype="charecter"/>
<parameter name="P_DIV_TO" datatype="charecter"/>
<parameter name="P_FROM_ORG" datatype="charecter"/>
<parameter name="P_TO_ORG" datatype="charecter"/>
<parameter name="P_FROM_INV" datatype="charecter"/>
<parameter name="P_TO_INV" datatype="charecter"/>
<parameter name="P_TRX_DATE_FROM" datatype="charecter"/>
<parameter name="P_TRX_DATE_TO" datatype="charecter"/>
</parameters>
<dataQuery>
<sqlStatement name="Q_1">
<![CDATA[SELECT DISTINCT MSI.CONCATENATED_SEGMENTS, MMT.INVENTORY_ITEM_ID,
MSI.DESCRIPTION, MMT.TRANSACTION_UOM, SDT.TRX_DATE,
MTP.ORGANIZATION_CODE, MMT.ORGANIZATION_ID
FROM MTL_MATERIAL_TRANSACTIONS MMT,
MTL_PARAMETERS MTP,
MTL_SYSTEM_ITEMS_VL MSI,
SSBWIP_DATE_TEMP SDT
WHERE MMT.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
AND MMT.ORGANIZATION_ID = MSI.ORGANIZATION_ID
AND MSI.ORGANIZATION_ID = MTP.ORGANIZATION_ID
AND MMT.ORGANIZATION_ID = MTP.ORGANIZATION_ID
AND MMT.TRANSACTION_TYPE_ID IN (17, 44)
AND MMT.ORGANIZATION_ID IN (
SELECT MP.ORGANIZATION_ID
FROM MTL_PARAMETERS MP, GL_CODE_COMBINATIONS GCC
WHERE MP.MATERIAL_ACCOUNT = GCC.CODE_COMBINATION_ID
AND GCC.SEGMENT1 = :P_LOB
AND (GCC.SEGMENT2 BETWEEN NVL (:P_DIV_FROM,
GCC.SEGMENT2)
AND NVL (:P_DIV_TO, GCC.SEGMENT2)
AND MTP.ORGANIZATION_CODE BETWEEN NVL (:P_FROM_ORG,
MTP.ORGANIZATION_CODE
AND NVL (:P_TO_ORG,
MTP.ORGANIZATION_CODE
AND MSI.CONCATENATED_SEGMENTS BETWEEN NVL
(:P_FROM_INV,
MSI.CONCATENATED_SEGMENTS
AND NVL
(:P_TO_INV,
MSI.CONCATENATED_SEGMENTS
ORDER BY MSI.CONCATENATED_SEGMENTS, MTP.ORGANIZATION_CODE]]>
</sqlStatement>
<sqlStatement name="Q_2">
<![CDATA[SELECT NVL (SUM (TRANSACTION_QUANTITY), 0) COMPLETION
FROM MTL_MATERIAL_TRANSACTIONS
WHERE INVENTORY_ITEM_ID = :INVENTORY_ITEM_ID
AND ORGANIZATION_ID = :ORGANIZATION_ID
AND TRANSACTION_TYPE_ID = 44
AND TRUNC (TRANSACTION_DATE) = :TRX_DATE]]>
</sqlStatement>
<sqlStatement name="Q_3">
<![CDATA[SELECT NVL (SUM (TRANSACTION_QUANTITY) * -1, 0) INCOMPLETION
FROM MTL_MATERIAL_TRANSACTIONS
WHERE INVENTORY_ITEM_ID = :INVENTORY_ITEM_ID
AND ORGANIZATION_ID = :ORGANIZATION_ID
AND TRANSACTION_TYPE_ID = 17
AND TRUNC (TRANSACTION_DATE) = :TRX_DATE]]>
</sqlStatement>
<sqlStatement name="Q_4">
<![CDATA[SELECT DESCRIPTION
FROM FND_FLEX_VALUES_VL
WHERE FLEX_VALUE_SET_ID = 1002470
AND FLEX_VALUE = :P_LOB]]>
</sqlStatement>
<sqlStatement name="Q_5">
<![CDATA[SELECT DESCRIPTION
FROM FND_FLEX_VALUES_VL
WHERE FLEX_VALUE_SET_ID = 1012471
AND FLEX_VALUE = :P_DIV_FROM
AND PARENT_FLEX_VALUE_LOW = :P_LOB]]>
</sqlStatement>
<sqlStatement name="Q_6">
<![CDATA[SELECT DESCRIPTION
FROM FND_FLEX_VALUES_VL
WHERE FLEX_VALUE_SET_ID = 1012471
AND FLEX_VALUE = :P_DIV_TO
AND PARENT_FLEX_VALUE_LOW = :P_LOB]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReport" source="PRODUCTION.beforereporttrigger(:P_TRX_DATE_FROM,:P_TRX_DATE_TO)"/>
<dataStructure>
<group name="G_CONCATENATED_SEGMENTS" source="Q_1">
<element name="CONCATENATED_SEGMENTS" datatype="charecter" value="CONCATENATED_SEGMENTS"/>
<element name="DESCRIPTION" datatype="charecter" value="DESCRIPTION"/>
<element name="TRANSACTION_UOM" datatype="charecter" value="TRANSACTION_UOM"/>
<element name="INVENTORY_ITEM_ID" datatype="number" value="INVENTORY_ITEM_ID"/>
<element name="ORGNIZATION_ID" datatype="number" value="ORGANIZATION_ID"/>
<group name="G_TRX_DATE" source="Q_1">
<element name="TRX_DATE" datatype="date" value="TRX_DATE"/>
<group name="G_1" source="Q_1">
<element name="ORGANIZATION_CODE" datatype="charecter" value="ORGANIZATION_CODE"/>
<group name="G_ORGANIZATION_CODEC" source="Q_2">
<element name="COMPLETION" datatype="number" value="COMPLETION"/>
</group>
<group name="G_ORGANIZATION_CODEI" source="Q_3">
<element name="INCOMPLETION" datatype="number" value="INCOMPLETION"/>
</group>
</group>
</group>
</group>
<group name="G_LOB" source="Q_4">
<element name="CF_LOB" datatype="charecter" value="description"/>
</group>
<group name="G_FROM_DIV" source="Q_5">
<element name="CF_DIVFROM" datatype="charecter" value="description"/>
</group>
<group name="G_TO_DIV" source="Q_6">
<element name="CF_DIVTO" datatype="charecter" value="descrption"/>
</group>
<element name="CS_COUNT" function="count()" datatype="number" value="G_CONCATENATED_SEGMENTS.CONCATENATED_SEGMENTS"/>
</dataStructure>
</dataTemplate>
Pls. suggest me.
nullHi,
without checked the whole document .... you've defined all paramaters as datataype charecter instead of character.
Regards
Rainer -
can we call an form (.fmx) or a report (.rep) from a database trigger. that is when there is some insertion in the table i want to call a report which will take the parameters from the table changed.
regards
vishalJDeveloper and ADF
-
Trigger problem (urgent)
Here is my trigger. it doesnt give any error but it doesnt work.
the aim:
i have 2 tables and 1 view. (i cannot change this structure currently.)
Registered (student, course) --table
WaitingFor (student, course, regisdate) --table
DemandOfCourses (student, course, situation) -- view. situation is either REGISTERED or WAITING
if a student unregisters from a course, the student who is waiting in the queue (WaitingFor) should be inserted into the Registered table for that course. (Some courses have capacity limits, some of them dont.)
Actually, there is an error named 'no data found'. however, i solve it using the exception stated in the trigger.
after deleting someone, it says '1 row deleted', but i dont see any change in the table. it doesnt work.
for example:
DELETE FROM DEMANDOFCOURSES WHERE STUDENT = 100026 AND COURSE = 'BLE788';
1 row deleted.BUT NOT.. i hope someone can help me.. i am not able to solve it..
CREATE OR REPLACE TRIGGER DemandOfCourses_T2_ID
INSTEAD OF DELETE ON DemandOfCourses
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
stud NUMBER;
crs VARCHAR2(15);
stud2 NUMBER;
BEGIN
SELECT student, course
INTO stud, crs
FROM (SELECT * FROM WaitingFor ORDER BY regisdate)
WHERE course = :OLD.course
AND rownum=1;
-- check if the student who wants to delete his registration is really registered
SELECT student
INTO stud2
FROM Registered
WHERE student = :OLD.student
AND course = :OLD.course;
-- IF STUDENT IS REALLY REGISTERED, DELETE HIS REGISTRATION.
IF (stud2 IS NOT NULL) THEN
DELETE FROM Registered
WHERE student = :OLD.student
AND course = :OLD.course;
END IF;
-- IF SOMEBODY IS WAITING FOR THE COURSE, DELETE HIM FROM THE WAITING LIST AND REGISTER HIM AND.
-- OF COURSE, IN ORDER TO REALIZE THIS, THE STUDENT WHO WANTED TO BE DELETED FROM THE COURSE
-- SHOULD HAD BEEN REGISTERED FOR THE COURSE, THIS TEST IS DONE BY (stud2 IS NOT NULL) HERE.
IF (stud IS NOT NULL) AND (stud2 IS NOT NULL) THEN
BEGIN
DELETE FROM WaitingFor
WHERE student = stud
AND course = crs;
INSERT INTO Registered
VALUES (stud, crs);
END;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;You can use the exceptions to decide whether or not to do the various operations.
I would write your trigger more like:
CREATE OR REPLACE TRIGGER demandofcourses_t2_id
INSTEAD OF DELETE ON demandofcourses
FOR EACH ROW
DECLARE
stud NUMBER;
crs VARCHAR2(15);
not_registered EXCEPTION;
BEGIN
-- Delete the registered student and check if we deleted a row
DELETE FROM registered
WHERE student = :old.student and
course = old.course;
IF SQL%ROWCOUNT = 0 THEN -- Nothing to delete so not registered
-- This will go to the EXCEPTION section at the bottom
RAISE not_registered;
END IF;
-- If we get here then the student was registered so
-- check if a student is waiting
-- If no student is waiting this will throw NO_DATA_FOUND and be caught
-- in the EXCEPTION BLOCK at the end
SELECT student, course
INTO stud, crs
FROM (SELECT * FROM waitingfor ORDER BY regisdate)
WHERE course = :OLD.course and
ROWNUM = 1;
-- If we get to here, then the student was registered, and there was
-- someone waiting so
DELETE FROM waitingfor
WHERE student = stud and
course = crs;
INSERT INTO registered
VALUES (stud, crs);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN not_registered THEN
NULL;
END; HTH
John
Message was edited by:
John Spencer
Honestly, Warren's last example and everything that followed wasn't there when I posted. -
Process task to Trigger (Very Urgent ) Urgent
Hi,
How can we achieve this requirement.Immediate response help us..Thanks in advance.
If cost center changes in HR file (user's profile), generate a change location provisioning task for the provisioner.
Show the provisioner….
Attributes :
New Cost Center number & New Cost Center name as well as
Old Cost Center number and Old Cost Center name.
Thanks,
ReddyHi Pallavi,
Thanks for the quick replay.
We have Two attributes called "Cost center name" and "cost center Number",We are changing the Cost center name from the user profile.
1."Change location update" task has to be trigger while changing "Cost center name" and This task has to be shown to defualt provisioner.
2.For the Default provisinoer " Process form has to show "old cost center name" and "New cost center name"
Regards,
Reddy. -
Mutuating trigger problem(Urgent)
Dear Sir ,
I want to write a trigger on a field which will change
the value of the same field in other row.But I am getting
Mutuatig trigger error will you help me in this regard ,Thanks
in Advance .
say I am storing menuname in a table "menus"
Name Level value Parent
File 0 Parent
New 1 Parent File
Company 2 child New if i change the level
of a menu all its child should also get updated?Please
Help.Since I don't know what's causing the initial update (i.e. what
exactly you application code does), then what I suggest will be
a guess at best.
Anyway, a row-level trigger will not allow the same table to be
directly or indirectly altered. This is a safety mechanism to
prevent an infinite loop of inserts or updates from occurring.
What you might want to consider instead is to encapsulate your
application logic in a stored procedure that performs all the
updates you require explicitly, with no triggers involved. -
Partial trigger problem URGENT plz help
I am using ADF10g with EJB
i have databount ADFSelectOneChoice and inputText,
the value of selectOneChoice is bound to list in page definition, and value of inputText is
bound to attributeValues in pagedefinition also
the autosubmit of ADFSelectOneChoice is true and its id is compList, the partialTrigger of inputText is set to be the id of the
list that is compList
the ADFSelectOneChoice refreshes the inputText successfully, but after i click a commanButton which saves data,
the ADFSelectOneChoice fails ti refresh the inpuText<?xml version="1.0" encoding="UTF-8" ?>
<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
version="10.1.3.42.70" id="testPageDef" Package="view.pageDefs">
<parameters/>
<executables>
<variableIterator id="variables">
<variable Type="java.lang.String" Name="getFiscalYear_companyCode"
IsQueriable="false"/>
<variable Type="java.lang.String" Name="getFiscalYear_Return"
IsQueriable="false" IsUpdateable="2"
DefaultValue="${bindings.getFiscalYear.result}"/>
</variableIterator>
<methodIterator id="getCompanyListIter" Binds="getCompanyList.result"
DataControl="SessionEJBLocal" RangeSize="-1"
BeanClass="model.datatransfer.company"/>
<invokeAction id="invokeGetFiscalYear" Binds="getFiscalYear"
Refresh="renderModel"/>
</executables>
<bindings>
<methodAction id="getFiscalYear" MethodName="getFiscalYear"
RequiresUpdateModel="true" Action="999"
IsViewObjectMethod="false" DataControl="SessionEJBLocal"
InstanceName="SessionEJBLocal.dataProvider"
ReturnName="SessionEJBLocal.methodResults.SessionEJBLocal_dataProvider_getFiscalYear_result">
<NamedData NDName="companyCode" NDType="java.lang.String"
NDValue="${bindings.getFiscalYear_companyCode}"/>
</methodAction>
<list id="companyCode" IterBinding="variables" StaticList="false"
ListOperMode="0" ListIter="getCompanyListIter">
<AttrNames>
<Item Value="getFiscalYear_companyCode"/>
</AttrNames>
<ListAttrNames>
<Item Value="companyCode"/>
</ListAttrNames>
<ListDisplayAttrNames>
<Item Value="companyName"/>
</ListDisplayAttrNames>
</list>
<methodAction id="getCompanyList"
InstanceName="SessionEJBLocal.dataProvider"
DataControl="SessionEJBLocal" MethodName="getCompanyList"
RequiresUpdateModel="true" Action="999"
IsViewObjectMethod="false"
ReturnName="SessionEJBLocal.methodResults.SessionEJBLocal_dataProvider_getCompanyList_result">
<NamedData NDName="lang" NDValue="#{'ar'}" NDType="java.lang.String"/>
</methodAction>
<attributeValues id="getFiscalYear1" IterBinding="variables">
<AttrNames>
<Item Value="getFiscalYear_Return"/>
</AttrNames>
</attributeValues>
<methodAction id="testSave" InstanceName="SessionEJBLocal.dataProvider"
DataControl="SessionEJBLocal" MethodName="testSave"
RequiresUpdateModel="true" Action="999"
IsViewObjectMethod="false"
ReturnName="SessionEJBLocal.methodResults.SessionEJBLocal_dataProvider_testSave_result">
<NamedData NDName="fiscalYear"
NDValue="${bindings.getFiscalYear1.inputValue}"
NDType="java.lang.String"/>
</methodAction>
</bindings>
</pageDefinition> -
AT SELECTION SCREEN OUTPUT
AT SELECTION-SCREEN ON VALUE-REQUEST
AT SELECTION-SCREEN ON HELP-REQUEST
AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON BLOCK
AT SELECTION-SCREEN ON RADIOBUTTON GROUP
can any one explain these events in detail and when they will trigger .Its urgent pleaseHi,
EVENTS in ABAP Report
These are the Events(In order of execution) in ABAP Report
1.INITIALIZATION
2.AT SELECTION SCREEN OUTPUT
3.AT SELECTION-SCREEN ON VALUE-REQUEST
4.AT SELECTION-SCREEN ON HELP-REQUEST
5.AT SELECTION-SCREEN ON
6.AT SELECTION-SCREEN ON BLOCK
7.AT SELECTION-SCREEN ON RADIOBUTTON GROUP
8.AT SELECTION-SCREEN
Selection screen processing starts after the INITIALIZATION event with AT SELECTION SCREEN OUTPUT. The selection screen is then sent to the screen. User actions on the selection screen result in other events that are either used for field or possible entries help, or that trigger PAI processing of the selection screen. During PAI processing, error messages in the relevant event blocks allow users to return to the selection screen. Only if the AT SELECTION-SCREEN event is exited properly, that is not through an error message, are the other events of the executable program triggered, starting with START-OF-SELECTION.
<b>INITIALIZATION</b>
This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen. This is the only possible way to change the default values of parameters or selection criteria defined in logical databases. To change a selection criterion, you must fill at least the components <seltab>-SIGN,
<seltab>-OPTION, and <seltab>-LOW of the selection table <seltab>, otherwise it remains undefined.
In the PBO of the selection screen, the
<b>AT SELECTION-SCREEN OUTPUT</b>
event is triggered. This event block allows you to modify the selection screen directly before it is displayed.
<b>AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field></b>
The event is triggered when the user calls the F4 help for the field <field>. If no corresponding event block has been defined, the possible values help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure that an appropriate list of values is displayed, and that the user can choose a value from it.
You cannot declare the event block AT SELECTION-SCREEN ON VALUE-REQUEST for input fields on the selection screen that are declared within a logical database. You cannot override the possible values help mechanism of a logical database within the program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONS statements.
<b>AT SELECTION-SCREEN ON HELP-REQUEST FOR <field></b>
The event is triggered when the user calls the F1 help for the field <field>. If no corresponding event block has been defined, the help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default help mechanism. It is then up to the programmer to ensure that appropriate help is displayed.
You cannot declare the event block AT SELECTION-SCREEN ON HELP-REQUEST for input fields on the selection screen that are declared within a logical database. You cannot override the help mechanism of a logical database within the program. You can define separate help within the logical database program using the HELP-REQUEST option in the PARAMETERS and SELECT-OPTIONS statements.
<b>AT SELECTION-SCREEN ON <field></b>
In the PAI event of the selection screen, the event
is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program. The input field <field> can be checked in the corresponding event block. If an error message occurs within this event block, the corresponding field is made ready for input again on the selection screen.
<b>AT SELECTION-SCREEN ON BLOCK <block></b>
In the PAI event of the selection screen, the event
is triggered when the contents of all of the fields in a block are passed from the selection screen to the ABAP program. You define a block by enclosing the declarations of the elements in the block between the statements SELECTION-SCREEN BEGIN OF BLOCK <block> and SELECTION-SCREEN END OF BLOCK <block>. You can use this event block to check the consistency of the input fields in the block. If an error message occurs within this event block, the fields in the block are made ready for input again on the selection screen.
<b>AT SELECTION-SCREEN ON RADIOBUTTON GROUP <radi></b>
In the PAI event of the selection screen, the event
is triggered when the contents of all of the fields in a radio button group are passed from the selection screen to the ABAP program. To define a radio button group <radi>, use the addition RADIOBUTTON GROUP <radi> in the corresponding PARAMETERS statements. This event block allows you to check the whole group. If an error message occurs within this event block, the radio button group is made ready for input again on the selection screen. The individual fields of radio button groups do not trigger the event AT SELECTION-SCREEN ON <field>.
<b>AT SELECTION-SCREEN</b> is the basic form of a whole series of events that occur while the selection screen is being processed.
The standard selection screen in an executable program or in the logical database linked to it is automatically called between the INITIALIZATION and START-OF-SELECTION events. When you call the selection screen, and when users interact with it, the ABAP runtime environment generates selection screen events, which occur between INITIALIZATION and START-OF-SELECTION.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b> -
Xmonad and pidgin conversation windows
Hi
Not sure if this is a Pidgin related problem, but I'm trying to get urgencyhook to work with new conversation windows in Pidgin - it doesn't trigger an urgent before I focus the conversation window and send a new message (from another workspace.. text based MSN client).
So basicly this is what's happening..
I write "Open new window please.." and a new conversation window is opened on workspace "im" - if I go to the "im" workspace and focus the conversation window, then go back to workspace 3 "code", and type another message.. I receive the urgent notification.
Anyone had this problem? I would love it to notify when opening a new conversation window. Using the "Message Notification" plugin for Pidgin.Incredibly fast.. this post is already on Google hehe.
Ok, so.. I edited the notify plugin (Message Notification), in src/src/pidgin-2.7.0/pidgin/plugins/ to print a debug message whenever a conersation window was opened, and it does:
(17:47:30) gtkspell: Failed to setup GtkSpell: enchant error for language: en_US.UTF-8
(17:47:30) gtkconv: setting active conversation on toolbar 0x983b110
(17:47:30) gtkconv: setting active conversation on toolbar 0x983b110
(17:47:30) prefs: /pidgin/conversations/toolbar/wide changed, scheduling save.
(17:47:31) notify: ***** CONVERSATION CREATED *****
(17:47:31) prefs: /pidgin/conversations/im/y changed, scheduling save.
static void
conv_created(PurpleConversation *conv)
purple_conversation_set_data(conv, "notify-message-count",
GINT_TO_POINTER(0));
purple_debug_misc("notify", "***** CONVERSATION CREATED *****\n");
/* always attach the signals, notify() will take care of conversation
* type checking */
attach_signals(conv);
Uhm, so.. it should notify, and it's being triggered. The problem must lie somewhere else. -
Regarding before insert and update trigger...Urgent!!
i have written a trigger to trim N upper the 1st field and trim N upper N replace period(.) for second field2 for future records.
When i compile, it says "complied with errors" is gives error as "insuffecient privlages"
Can anyone please figure out what problem is this??? And is my code correct?? if any changes to be done please let me know????
create or replace trigger TRG_test
before insert or update on test
for each row
declare
begin
:new.field1 := trim(upper(:new.field1));
:new.field2 := trim(upper(replace(:new.field2,'.' )));
end;
Urgent please!!!
Thank you in advance.The owner of the tables is User 2 and i am creating the trigger in user1 N i m calling this table from user2...as User2.TEST ...
User 1 as has previliges to acess the user 2 tables, since user2 tables are listed under user1 table section...
Do you system privilages????
I m using PL/SQL devloper tool.... -
Help on Procedure and trigger for updating(urgent please)
SQL> / Table A
CTUT_ID CTUT_COMPANY_NAME CURRT_USER_ID FMIS_ID CREATE_DA UPDATE_BY UPDATE_DATE
1234 A 15-APR-03
2222 B 15-APR-03
3333 C 15-APR-03
4444 D 15-APR-03
5555 E 15-APR-03
6666 F 15-APR-03
150282 G oRACLE 23-APR-03
1 H 15-APR-03
2 I 15-APR-03
3 J 15-APR-03
150343 K TIGER 24-APR-03
150305 L EXAMPLE 23-APR-03
150342 M SCOTT 24-APR-03
sQL >/ Table B
Empno Empname UPDATE_BY UPDATE_DATE
1 AA
2 BB
3 CC
4 DD
What i need to do is i need to create an update trigger on both tables
like create a procedure
1)In procedure i need to check like
IF TABLEA.CURRT_USER_ID = (SELECT USER FROM DUAL)
THEN
UPDATE_BY = (CURRENT_USER_ID of CTUT_ID)
FOR EXAMPLE CURRENT USER_ID IS SCOTT THEN
UPDATE_BY = 150342
UPDATE_DATE = SYSDATE
ELSIF
UPDATE_BY <=> (CURRENT_USER_ID of CTUT_ID)
THEN
MESSAGE('USER IS NOT IN TABLE);
END IF;
and call that procedure in the update triggers
FOR BOTH TABLES TABLEA,TABLEB
i CREATED A PROCEDURE BUT IT IS NOT WORKING
ANY HELP PLEASE
CREATE OR REPLACE PROCEDURE UPDATE(
UPDATE_DATE out DATE,
UPDATE_BY out VARCHAR2)
IS
Uuser varchar2(20);
Udate date;
Ufound number(1);
BEGIN
SELECT USER,SYSDATE
INTO Uuser,Udate from dual;
SELECT count(*),CTUT_ID into Ufound,Uctut_id
FROM TABLEA
WHERE CURRT_USER_ID = Uuser
Group by Ctut_id;
IF (UFOUND = 1) THEN
UPDATE_DATE := UDATE;
UPDATE_BY := UCTUT_ID;
END IF;
EXCEPTION WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20001,'User Does not Exist');
END UPD_CONSTITUENT;
CREATE A TRIGGER :
CREATE OR REPLACE TRIGGER TU
BEFORE INSERT ON TABLEA
FOR EACH ROW
BEGIN
UPDATE(:NEW.update_date,
:NEW.update_BY);
END IF;
END;
SQL> update TABLEA
2 set CTUT_COMPANY_NAME = 'SCOTT TEST'
3 WHERE FMIS_USER_ID = 'N';
update TABLEA
ERROR at line 1:
ORA-04091: table TABLEA is mutating, trigger/function may not see it
ORA-06512: at "UPDATE", line 12
ORA-06512: at "TU", line 1
ORA-04088: error during execution of trigger 'TU'Hi Mara,
You are right thats what i want
I have a table A
EmpNo Empname Currtuser_id Update_date Updateby
1 Denis Oracle
2 Scott Scott
3 Mara MMara
1)what i need to do is when any user tries to update the table Table A
Then the Trigger or procedure should check whether user is exits in table A in column currtuser_id
If his user id exits in table A
Then allow him to update the TABLE A
and insert his EMPNO in UPDATE_BY
and SYSDATE in UPDATE_BY
He will do all this process using forms
But i need to have trigger or procedure in database level for table
2) I have another table like 10 tables
Suppose TABLE B
When user tries to update TABLE B
Then the Trigger or procedure should check whether user is exits in table A in column currtuser_id
If his user id exits in table A
Then allow him to update the TABLE B
and insert his EMPNO in UPDATE_BY
and SYSDATE in UPDATE_BY
3) I need to have a common Procedure and call that procedure in all tables in UPDATE TRIGGER
Thanks for your help
Thanks -
[PLEASE] Prob with instead of Trigger [URGENT !]
Hi,
I have an INSTEAD OF TRIGGER on a view which update 2 based tables.
Each time the user update information,the system processes the update operation and insert a new row into the base tables.None of the based tables has any trigger.
Why this insertion occures ? How can i stop it and update only the based tables without inserting the same row ?
Thks for your advice
lamine
SQL> CREATE OR REPLACE TRIGGER UPDATE_PP_TR
SQL> INSTEAD OF UPDATE ON V_CONTACTS1_PP
SQL> FOR EACH ROW
SQL> begin
SQL> update ORGANIZATIONS
SQL> set
SQL> org_name = nvl(:new.org_name,org_name)
SQL> .....
SQL> ,updated_by = v('USER')
SQL> ,updated_date = sysdate
SQL> where org_id = :new.org_id;
SQL> update INDIVIDUALS
SQL> set
SQL> ,gender = nvl(:new.gender,gender)
SQL> ,first_name = nvl(:new.first_name,first_name)
SQL> ,last_name = nvl(:new.last_name,last_name)
SQL> ......
SQL> ,updated_by = v('USER')
SQL> ,updated_date = sysdate
SQL> where org_id = :new.org_id;
SQL> end UPDATE_PP_TR;Thks Andrew for your reply,
The INSTEAD OF trigger doesn't insert new row as i said before.... apologies.... It processes 2 things:
- update the field with the new value (what i want)
- Replace any existing data that has the same reference_key by the new value.
If we change the email of an individual and it happens that they are many people in the same company,then the INSTEAD OF TRIGGER updates the email and replace the other employees records by the one that has been updated.
But if the company employes only 1 person then the process is ok.It's bizarre only for many employees in the same company.
i.e:
Martin Tom , [email protected], FRANCE SOFT
Paul Henri, [email protected], FRANCE SOFT
Jason Case, [email protected], FRANCE SOFT
If i update Martin Tom's email to [email protected], Paul and Jason would be replace by Marin Tom's record....
Martin Tom , [email protected], FRANCE SOFT
Martin Tom , [email protected], FRANCE SOFT
Martin Tom , [email protected], FRANCE SOFT
Maybe my instead of trigger is written improperly.....
Any advise ? -
Regarding Procedure & Trigger (Plz Some one Help me... Its Urgent)
HI,
I think its a Big Message........ I dont know How many Will have patience in reading this...... Sorry for this Inconvience........
Iam having 4 tables:
3 Input table and 1 target table.
LOgic: Want to Load in the Target table From the input table Based on Some Criteria
Input Tables:
Table 1:Tbl_A
It has ID and Name
TBL_A
Ex: ID Name
201 Anu
202 Banu
203 Chitra
Table 2: Tbl_B
It has Name and Id
(The record of Column Name in this table should Contain the same Names of Tbl_A and id should be different from Table a)
TBl_B:
ID NAME
501 Anu
502 Banu
503 Chitra
Table 3: TBL_C
(It is independent on both Tbl_A and Tbl_b)
it has this Static records as Follows:
TBL_C
ID NAME
1 A
2 P
Output Table:
TBL_Target: ( It has 3 columns): ID,Source id, and Identifier
ID SRC_ID IDENTIFIER
LOgic:
For Loading data into Target tbl :TBL_Target
1. Procedure should have 'Name' of TBL_C as input parameter. So input will be
'A' or 'P'
*Based on the input Name from TBL_C the corresponding ID should be taken
from TBL_C and inserted into the ID Column of TBL_Target
EX: IF 'A' Then 1 Should be inserted . IF P means 2 should be inserted
2. we have to select the IDs from TBL_A and TBL_B based on Their Names as Join condition and insert the ID of TBL_A into IDENTIFIER Column of TBL_Target
and insert the ID of TBL_B into SRC_ID Column of TBL_Target
(Note: Actually We have to get the ID'S of all the rows from TBL_A and TBL_B based on their join Condition and load into Target table)
Out PUt: ( if the input of Procedure is 'A')
TBL_Target
ID SRC_ID IDENTIFIER
1 501 201
1 502 202
1 503 203
Out PUt: ( if the input of Procedure is 'P')
TBL_Target
ID SRC_ID IDENTIFIER
2 501 201
2 502 202
2 503 203
LOgic2:
I want to Write a Trigger So that Whenever Iam Inserting New Records in TBL_A
the Trigger should Call the Procedure We have Created
Thanks......Hi,
I created a Trigger based on After inserting.....
I called the Procedure inside the Trigger.....
Trigger is created. But While executing the trigger it Throws an error: Table is Mutating .Trigger or Function May not see it.
This is the procedure Created:
CREATE OR REPLACE PROCEDURE Proc_Load (Tblc_Name in Varchar2)
AS
-- VARIABLE AND CURSOR DECLARATION:
V_name Varchar2(100);
V_id_c number;
V_id_a number;
V_id_b number;
CURSOR cur_name IS SELECT a.id,b.id
FROM tbl_a a,tbl_b b WHERE TRIM(a.name)=TRIM(b.name);
begin
V_name:=Tblc_name;
SELECT id INTO V_id_c FROM Tbl_c WHERE name=V_name;
OPEN Cur_name;
LOOP
FETCH cur_name INTO V_id_a,V_id_b;
INSERT INTO tbl_target VALUES (V_id_c,V_id_b,V_id_a);
COMMIT;
EXIT WHEN (cur_name %NOTFOUND);
END LOOP;
CLOSE Cur_name;
END;
Trigger Created:
CREATE OR REPLACE TRIGGER Trig_name
AFTER INSERT ON TBL_A
FOR EACH ROW
BEGIN
Proc_Load ('A');
END;
If iam Executing trigger Error OCcurs Table is Mutating .Trigger or Function May not see it.
How to solve it? -
Need Urgent Help with trigger in Oracle 10g
Hello frd,
I am working on my DBMS Project in VB 6.0 that is Tollbooth management system
i have to insert one trigger for my project so i had decided to insert time trigger.
I have total 3 table UserLogin, Vehice and Vehicle_Data
the 3rd table Vehicle data contain the following fields
Vehicle_Type, Vehicle_No, Tax_Time, Source, Destination and Tax
Now i had done coding for tax when you select Vehicle Type, Source and Destination the Tax Field will automatically fillup and all the data will Saved in Oracle table but now my problem is that i want to create trigger for Tax_Time column When any new data inserted current time will stored in that column
I had create one but it gives error
create trigger time after insert on vehicle_Data
for each row
begin
insert into Vehicle_Data(Tax_Time) values(to_char(sysdate, 'HH:MI:SSAM DD_MON_YYYY'));
end;
Note: I am Using VB 6.0 and Oracle 10g Express EditionI had create one but it gives errorWelcome to the forum and many many thanks for not posting the full error message, that is really helpful, since we're all a 100% sure what's going on now (yes, that was ironic ;) ).
Let me guess: a mutating table error?
Read:
http://www.oracle-base.com/articles/9i/MutatingTableExceptions.php
http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936
But before that, actually you should read:
http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
Maybe you are looking for
-
Error While processing Message-Message no. VL086
Dear All, While Processing Outbound delivery in VL02N i am getting the below following error message. Please help me out. Error msg - output could not be issued. Message no. VL086 Diagnosis An error occurred in the message processing program. Regards
-
New to Aperture 3 - Q on importing and Sharing
First up; I've tried importing the iPhoto library into Aperture which it seems to do ok however, it seems to import as 'projects & events' as opposed to 'albums' which I've created iPhoto, this is mainly an issue for me as I have over 16'000 pictures
-
Making slideshow for 1 jpeg, ken burns effect for 60 seconds freezes unit
trying to make a slideshow using 1 jpeg, ken burns effect turned on for 60 seconds in slideshow "settings", sometimes it makes a movie which will fill up the hd, hd space available is 67 gigs, ram is 1 gig, then we will get message saying that the hd
-
How to snap to top/bottom of mail?
How do we get to the top/bottom of list of emails in Mac Mail?
-
Hello, I´m trying to install Debian Linux client http://www.microsoft.com/en-us/download/details.aspx?id=36212 following this article http://sccmfaq.wordpress.com/2013/06/29/sccm-2012-sp1-using-linux-client-on-debian-6/ When I try to execute with t