Skip to Content
0
Jun 01, 2022 at 02:20 PM

Updating Database with using a Parameter

102 Views Last edit Jun 06, 2022 at 05:34 PM 2 rev

I am trying to update my database using a command in my crystal sub report with a parameter. I am using the following command in my subreport to test my functionality.

Declare

R_Inv5 varchar(30);

LABELID NUMBER(9,0);

begin

Update arinvt set cuser5 = '66666' where id = 202685;

if {?Pm-MASTER_LABEL.ID} is null then

select 9385776 into LABELID from DUAL;

else

select {?Pm-MASTER_LABEL.ID} into LABELID from DUAL;

end if;

update master_label set inv_cuser5 = '666769'

where id = LABELID;

update lminvtry set inv_cuser5 = '8884444' where master_label_id = 9385776;

select 9378870 into LABELID from DUAL;

end;

The highlighted line where I Have hardcoded the master_label_id appears to be executed but the command using the {?Pm-MASTER_LABEL.ID} parameter does not appear to execute.

When I use the parameter in a select command its appears to work so the parameter value appears to get passed into the command correctly.

select m.inv_cuser5,l.inv_cuser5 as luser5,{?Pm-MASTER_LABEL.ID} as id from master_label m

join lminvtry l on l.master_label_id = m.id

where m.id = {?Pm-MASTER_LABEL.ID}

ID from above displays on subreport with correct value.