save trigger not working [message #414481] |
Wed, 22 July 2009 05:54 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
hii
i had made a form using datablock wizard
and the structure of table which i used is as follows:-
Describing prtrmsg....
NAME Null? Type
------------------------------- --------- -----
EMPNO NOT NULL VARCHAR2(8)
STARTPAYPERIOD NOT NULL VARCHAR2(6)
ENDPAYPERIOD VARCHAR2(6)
MESSAGE1 VARCHAR2(38)
MESSAGE2 VARCHAR2(47)
MESSAGE3 VARCHAR2(47)
MESSAGE4 VARCHAR2(47)
i have two blocks in the form
1)prtrmsg in which i have item's empno
to populate the empno item i had made a lov using emp table and using record grp query as select distinct empno from emp;
2)prtrmsg1 in which i have item's empno,startpayperiod,endpayperiod,message1,message2,message3,
message 4
and i had created master-detail relation using the where condition
prtrmsg.empno=prtrmsg1.empno
and in form i had placed a push button on which i m writting the
when-button-pressed trigger
if :system.form_status='changed' then
commit_form;
end if;
when i clicking on the push button i m not getting any result could someone please help me out to remove this problem
[EDITED by LF: applied [code] tags]
[Updated on: Wed, 22 July 2009 06:08] by Moderator Report message to a moderator
|
|
|
|
Re: save trigger not working [message #414492 is a reply to message #414484] |
Wed, 22 July 2009 06:22 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
thanks for the help sir.
but when i replaced the changed with CHANGED
and then clicked then button
then i get an error i.e
FRM-40508:ORACLE error:unable to INSERT record
and when i m pressing shift+f1 to get more about the error
then i m getting a database error window
which has the following explanation:-
SQL statement in error :
INSERT INTO PRTRMSG(EMPNO,ITEM5) VALUES (:1,:2)
Error:ORA-00904: invalid column name
could you please help me out
|
|
|
Re: save trigger not working [message #414495 is a reply to message #414492] |
Wed, 22 July 2009 06:27 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
sorry i forgot to tell that in my first block
i have empno item
and one more text item
which is used to display the empname
the lov i m using to populate these item is based on the record grp query as
select empno,empname
from prmaemp
|
|
|
|
Re: save trigger not working [message #414514 is a reply to message #414492] |
Wed, 22 July 2009 07:23 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
simcky wrote on Wed, 22 July 2009 12:22 |
SQL statement in error :
INSERT INTO PRTRMSG(EMPNO,ITEM5) VALUES (:1,:2)
Error:ORA-00904: invalid column name
|
Seems fairly obvious - I doubt the table prtmsg contains a column called item5.
Try changing item5's database item property to No.
|
|
|
Re: save trigger not working [message #414618 is a reply to message #414514] |
Thu, 23 July 2009 00:12 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
Thanks for the help Mr.cookiemonster
but when i set the database property of item5 to no then again i m getting the same error FRM-40508:ORACLE error unable to insert record
and when i m pressing shift+f1
then i got
database error
sql statement in error:
INSERT INTO PRTRMSG(EMPNO) VALUES (:1)
Error:
ORA-01400: cannot insert NULL into ("NAV"."PRTRMSG"."STARTPAYPERIOD")
Where NAV is my database name.
please help me out to remove this problem
|
|
|
|
|
Re: save trigger not working [message #414693 is a reply to message #414618] |
Thu, 23 July 2009 03:59 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
simcky wrote on Thu, 23 July 2009 06:12 |
sql statement in error:
INSERT INTO PRTRMSG(EMPNO) VALUES (:1)
Error:
ORA-01400: cannot insert NULL into ("NAV"."PRTRMSG"."STARTPAYPERIOD")
|
Well that insert is only supplying values for empno, so the error is predictable.
Have you got two blocks based on the same table?
|
|
|
|
Re: save trigger not working [message #414721 is a reply to message #414481] |
Thu, 23 July 2009 05:31 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
So the first block which only has empno is trying to do an insert and failing because it can't supply values for all the not null columns.
You need to make that first block a non database block or get rid of it entirely.
|
|
|
|