Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

frm-40405...

Status
Not open for further replies.

vpv

Programmer
Oct 30, 2003
24
RU
how can i avoid error "frm-40405..."?
i have next text:

system.message_level:='10';
synchronize;
....
INSERT INTO DELTA.chk_inv@DELTA_DBL (date_rev,
sum_42301_rur,sum_42301_val,chk_42301....
COMMIT;
go_block('chk_inv');
clear_block(no_validate);
execute_query;

Why?
After second execution, error show again...
 
Actually it's not recommended to issue insert from pl/sql, because Forms knows nothing about the current state of transaction if no changes in database blocks are made. COMMIT command within trigger is interpreted as COMMIT_FORM, causing that error. You may call FORMS_DDL('COMMIT'). But again, it's better to create a block based on DELTA.chk_inv and add a record to it.

Regards, Dima
 
thanks sem.
In other words, i need to use "insert_record" built-in?
Block chk_inv exist already...then
:date_rev:=dt1;
select sum(amount) into :sum_42301_rur from delta.lim...
select sum(rez) into :sum_42301_val from delta acl..
go_block(chk_inv);
insert_record;
post;
It's correctly way?

 
You don't need insert_record after assigning values. If your block is "CLEARed" your current record is a new one, thus you only need to assign values and le Forms to make the thing. POST applies changes (inserts into database), but in fact even without it COMMIT makes the same and then commits a transaction.
Code:
go_block('chk_inv');
if :system.record_status<>'NEW' then
  create_record;
end if;
:chk_inv.date_rev:=dt1;
select sum(amount) into :chk_inv.sum_42301_rur from delta.lim...
select sum(rez) into :chk_inv.sum_42301_val from delta acl..
post;-- optional, if you really need to insert [b]right now[/b]

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top