how to execute dynamic sql in procedure
I need to execute multiple dynamic select statement in procedure and display count on screen. here i wrote the procedure. but not working properly.
create or replace procedure sqlexe (data_value IN varchar2)
IS
stringtext varchar2(1000);
v_data_value varcha2(30);
BEGIN
v_data_value:=data_value;
select 'select 'SELECT count(*) FROM C' || EC_SERVER_SECURITY_CODE || '.' || 'V_Platform_Module_Count WHERE DATA_VALUE = '|| '''v_data_value''' || ';' from customer_info'
into stringtext from customer_info;
execute immediate stringtext;
END;
show error
- Error(7,152): PLS-00103: Encountered the symbol " from customer_info" when expecting one of the following: ( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with
0