Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multiple Execute Immediate?

505977May 26 2006 — edited May 26 2006

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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2006
Added on May 26 2006
5 comments
675 views