how to insert a user name to every setup(where insert is done) form [message #293566] |
Mon, 14 January 2008 02:12 |
|
hello David and All,
Thanks for the earlier hints. i Have solved them out. Now i am facing a new problem. i wanted to insert the user name to each set up forms but cant get the data.
1. At first i login into the system and stored the username into a temp_user table.
2. from the menu i have called the Area in charge form to enter the data along with the username whichi have already inserted inot the temp_user table. for insert i have write the script as follows:
...............................................................
When Button Pressed
............................................................
Declare
cursor AREA is select ARC_id from PBL_DO.AREA_IN_CHARGE_TABLE where ARC_ID=:ARC.ARC_ID;
cursor mmm is select usrnm from PBL_DO.APP_USER;-- WHERE USRNM=:BLOCK8.USRNM;
mAREA varchar2(4);
nnn varchar2(4);
jk number;
Begin
jk:=:system.message_level;
:system.message_level:=10;
if :ARC.ARC_ID is null then
message ('Please insert AREA IN CHARGE IDENTIFICATION');
raise form_trigger_failure;
end if;
if :ARC.ARC_NAME is null then
message ('Please insert AREA IN CHARGE NAME');
raise form_trigger_failure;
end if;
Open AREA;
fetch AREA into mAREA;
open mmm;
fetch mmm into nnn;
if AREA%notfound then
insert into PBL_DO.AREA_IN_CHARGE_TBL(ARC_ID,ARC_NAME,DESIGNATION_ID,REMARKS,USRNM) values (:ARC.ARC_ID,:ARC.ARC_NAME,:ARC.DESIGNATION_ID,:ARC.REMARKS,:ARC.USRNM);
commit;
message('Data Inserted Successfully');
go_block('ARC');
execute_query;
:ARC.ARC_ID := '';
:ARC.ARC_NAME := '';
:ARC.DESIGNATION_ID :='';
:ARC.REMARKS :='';
:ARC.USRNM :='';
-- go_block ('ARC');
go_item ('ARC.ARC_ID');
end if;
:system.message_level:=jk;
Exception
when others then
message('Error, contact with MIS Department');
raise form_trigger_failure;
End;
Begin
--select nvl(max(bank_id),0) into f from chk_print.bank_info;
--:ARC.bankid := f+1;
select to_char(nvl(max(to_number(ARC_ID)),0) + 1) into :ARC.ARC_ID from
PBL_DO.AREA_IN_CHARGE_TABLE;
End;
-----------------------------
but its not working. So will you Please Help me as soon as possible. i am waiting for your kind reply
Mahatab, Dhaka.
|
|
|
|