I'm going to create a edit button that will edit the contents the forms named MEMBERS in Oracle Forms Builder. I already did the ADD button and this is the code (this button is located at the MEMBERS_ADD form):
NOTE: The name of the table is MEMBER also and these are the columns of the member table
-member_id
-firstname
-lastname
-gender
-address
-contact
-type
-yearlevel
-status
begin
commit_form;
first_record;
LOOP
INSERT INTO MEMBERS
SELECT * FROM MEMBERS WHERE MEMBER_ID = MEMBER_ID;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
COMMIT;
MESSAGE('RECORD SAVED!');
MESSAGE(' ',no_acknowledge);
end;
This is the code im using for the edit button:
DECLARE
pl PARAMLIST:=GET_PARAMETER_LIST('PL_EDIT_MEM');
BEGIN
IF NOT ID_NULL(pl) THEN
DESTROY_PARAMETER_LIST(pl);
END IF;
pl:=CREATE_PARAMETER_LIST('PL_EDIT_MEM');
ADD_PARAMETER(pl, 'P_MODE', TEXT_PARAMETER, 'EDIT');
ADD_PARAMETER(pl, 'P_MEMBER_ID', TEXT_PARAMETER, :MEMBERS.MEMBER_ID);
CALL_FORM('MEMBER',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,pl);
END;
the code gives me an error : FRM-40010: Cannot read from MEMBER
My problems are
- first, i really don't understand the code
- second, I'm wondering if i also need to loop when editing the content of the table because the add button was looped
- third, please help me to have a better code than this please please