0
votes

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
1

1 Answers

0
votes

Your edit button prepares a Parameter list, populates the parameters and then does a call_form to open a form called "member".

You're getting FRM-40010 error because Forms server can't find member form executible file(member.fmx). I hope you have compiled the form and created the fmx file. If not, hit Ctrl+Shift+K to compile all and the Ctrl+T to generate the fmx file.


As far the first piece code, the loop makes no sense, because it's just doing a self join (see the bit: WHERE MEMBER_ID = MEMBER_ID - I hope that's a typo?) and then inserting into the same table it's selecting from from