Home » Developer & Programmer » Forms » how to insert a user name to every setup(where insert is done) form
how to insert a user name to every setup(where insert is done) form [message #293566] Mon, 14 January 2008 02:12 Go to next message
mahatab
Messages: 98
Registered: January 2008
Location: Dhaka
Member

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.

Re: how to insert a user name to every setup(where insert is done) form [message #293739 is a reply to message #293566] Mon, 14 January 2008 17:13 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I really don't think this is the best way to program when using Oracle Forms. Just base your form on the 'AREA_IN_CHARGE_TBL' table and continue on from there.

I suggest you read and work through some of the tutorials before writing your first form.

David
Previous Topic: how long 'Oracle Corp' supports CUI mode.?
Next Topic: Scroll Bar in 10g
Goto Forum:
  


Current Time: Fri Dec 09 04:16:47 CST 2016

Total time taken to generate the page: 0.06619 seconds