FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-01422 [message #412388] |
Thu, 09 July 2009 02:11 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
hey guy's i just a newbie to oracle6i i made a form using datablock wizard in which i had taken three blocks using only one database table the structure of table is as follows
desc prmamed
Describing prmamed....
NAME Null? Type
--------------------------------------------------------------------------------
---------
--------------------------------------------------------------------------------
EMPNO NOT NULL VARCHAR2(8)
EARNINGDEDUCTION NOT NULL VARCHAR2(5)
PAYPERIOD NOT NULL VARCHAR2(6)
REFNO NOT NULL VARCHAR2(15)
REFDATE DATE
AMT NUMBER(5,0)
PAYCALPERIOD VARCHAR2(6)
BILLNO VARCHAR2(8)
CHANGEDATE DATE
USERID VARCHAR2(30)
and in form my
first block name is med and in this i m taking only empno and earningdeduction item's
second block name is pramamed1 and in this block i m taking payperiod,refno,refdate,amt,paycalperiod and in this block i m only fetching the data from database to display
and third block name is prmamed2 and in this block i m taking payperiod,refno,refdate,amt,paycalperiod and i m trying to save and update data from form to database in this block.
when on a push button i m writting the trigger which is as follows
declare
v_payperiod varchar2(6);
v_refno VARCHAR2(15);
v_refdate DATE;
v_amt NUMBER(5,0);
begin
go_block('prmamed2');
first_record;
go_item('prmamed2.payperiod');
select payperiod,refno,refdate,amt into v_payperiod,v_refno,v_refdate,v_amt from PRMAMED where empno=:med.empno and earningdeduction=:med.earningdeduction and paycalperiod is null;
loop
if
:prmamed2.payperiod <> v_payperiod
then
update PRMAMED
set payperiod=:prmamed2.payperiod
where empno=:med.empno and earningdeduction=:med.earningdeduction and paycalperiod is null;
elsif
:prmamed2.refno<>v_refno
then
update PRMAMED
set refno=:prmamed2.refno
where empno=:med.empno and earningdeduction=:med.earningdeduction and paycalperiod is null;
elsif
:prmamed2.refdate<>v_refdate
then
update PRMAMED
set refdate=:prmamed2.refdate
where empno=:med.empno and earningdeduction=:med.earningdeduction and paycalperiod is null;
elsif
:prmamed2.amt<>v_amt
then
update PRMAMED
set amt=:prmamed2.amt
where empno=:med.empno and earningdeduction=:med.earningdeduction and paycalperiod is null;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' ;
next_record;
commit_form;
end if;
end loop;
end;
i m getting the error i.e frm-40735 when-button-pressed trigger raised unhandled exception ORA-01422
please help me out to remove this prob............
[MERGED by LF]
[Updated on: Fri, 10 July 2009 02:14] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: updating, deleting and inserting [message #412574 is a reply to message #412567] |
Fri, 10 July 2009 01:06 |
shaz
Messages: 182 Registered: June 2009
|
Senior Member |
|
|
just code a form, and run it.
At the top you will see many icons like save, exit, enter query mode, execute query mode, exit query mode, insert, delete, etc.
To Insert data:
just click on insert button, enter data in fields and press the save button.
to execute and delete:
press the enter query button, give the id or whatsoever in the field and press execute query. now press the delete button to delete it.
like wise you can perform many tasks. just explore.
|
|
|
Re: updating, deleting and inserting [message #412597 is a reply to message #412574] |
Fri, 10 July 2009 02:05 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
hii shaz thanks for the help but dear if we are making form for clients who don't the use of all these icon's than at that tme we will have to write trigger like which i posted before is there any other solution to this ........
|
|
|
|
|