I'm pretty sure I can do this but wanted to post it to get any comments or possible problems. This is only part of the procedure and not all of it. I am just wondering if I can do multiple execute immediate statements just with different using clause. All exception handling is in place but not shown below (exception block).
/* Build sql statement */
if v_delete_flag is null then
v_sql := 'Insert into ' || v_stable
|| ' (kpi_id, value_type_cd, kpi_value, scorecard_id, kpi_class_id, start_time_cd, level_id)'
|| ' Values(:kpi_id, :value_type_cd, :kpi_value, :scorecard_id, :kpi_class_id, :start_time, :level_id)';
/* Generate ACTUAL record */
execute immediate v_sql
using v_kpi_id, 'A',
v_c8data,
v_scorecard_id,
v_kpi_class_id,
v_c8date,
v_time_level;
/* Generate TARGET record */
execute immediate v_sql
using v_kpi_id, 'T',
v_targetdata,
v_scorecard_id,
v_kpi_class_id,
v_c8date,
v_time_level;
end if;
Thanks,
Greg