Hello, I have spent some time trying to fix the syntax so I can handle the exception when no data found is found when trying to allocate data to a variable. If this is the case I want the code to assign just string := ' ';
Below is my attempt to solve it (which does not work). All help greatly appreciated:
Here is the part of the code where the problem is:
select substr(REPLACE(BBC.business_class_level_2_name, ',', ''),1,50)
into substring1 from tmsdat.a_secs_business_class BBC
where tupel.sec_ref = BBC.sec_ref;
Exception
when no_data_found then
substring1 := '';
COMMIT;
ROLLBACK;
End;
select substr(REPLACE(BBC.business_class_level_3_name, ',', ''),1,50)
into substring2 from tmsdat.a_secs_business_class BBC
where tupel.sec_ref = BBC.sec_ref;
Exception
when no_data_found then
substring2 := '';
COMMIT;
ROLLBACK;
End;
etc
[\code]