0

I'm trying to update user input field on click of a button in html form. so far my html form should call another procedure inside my package on click of the 'Update ID' button.However, i'm just receiving system error and no data is exactly being updated into the field.
Input field id is 'localid' and the table is called GENERAL.GORADID and the column name is goradid_additional_id. However, for some reason i'm able to call the procedure with the click of the btn but the column on the table does not update.

-- button to submit in in plsql -- this button in a procedure called (p_gre_id)

htp.formopen('BANINST1.HWKZLISS.P_UPDATE_ID','post');
htp.formsubmit('','Update ID');
htp.formclose;

-- the update code -- in a procedure called (p_update_id)

CURSOR C_UPDATE IS
        SELECT
            GORADID_ADDITIONAL_ID, 
            GORADID_PIDM,
            SPRIDEN_PIDM
        FROM GENERAL.GORADID, SATURN.SPRIDEN
        WHERE GORADID_ADDITIONAL_ID IN localid
        AND SPRIDEN_ID IN bannerid
        AND SPRIDEN_CHANGE_IND IS NULL;

BEGIN

     FOR REC IN C_UPDATE LOOP
     IF localid IS NOT NULL THEN 
     UPDATE GENERAL.GORADID
     SET GORADID_ADDITIONAL_ID = localid 
     WHERE GORADID_PIDM = SPRIDEN_PIDM;

     COMMIT;
     END IF;    
     END LOOP; 
A. Rahman
  • 71
  • 5
  • Because of your IF statment you are only executing the update if localid IS NULL. So this will always put null in the field. I think what you possibly want to do is.... if localid is not null then – Shaun Peterson May 23 '17 at 23:16
  • @ShaunPeterson i did that but again no results – A. Rahman May 24 '17 at 09:27
  • Couple of things to try... 1) Try removing IF statement and hard coding a value into the update. This will tell you if you are even getting into your procedure. 2) If you confirm that you are getting into your procedure then add a debug statement to find the value of localid just before the IF. My guess is that localid is ending up as null somehow. – Shaun Peterson May 25 '17 at 22:44
  • @ShaunPeterson i've tried various and several things you have suggested but cant seem to get anywhere for some reason – A. Rahman May 30 '17 at 14:10
  • You have tried.... but what were the results? did removing the if statement and hard coding a value work? What was the output of the debug statements? Just before the if, inside the if before the update and after the update? to be able to assist we need this detail of information – Shaun Peterson Jun 02 '17 at 00:53
  • @ShaunPeterson well i end up getting system error. so im assuming nothing is being submitted. Also i changed my coding a little bit more. – A. Rahman Jun 06 '17 at 09:31

0 Answers0