I am new to PL SQL Procedures , we have this line of code inside the Execution section of a Stored Procedure .
I am having a query here , please tell me whats the use of using EXECUTE IMMEDIATE
for a DML Statement Here ? and in what cases we should use EXECUTE IMMEDIATE
?
v_update_query2 := 'INSERT INTO '||p_country||'.DETAILS ( ID, STATUS, DEST_SYSTEM, OUT_TIME ) VALUES ('''
||v_txn_id ||''','||'''T081'''||','||'''CLEARING'''||', SYSDATE)';
EXECUTE IMMEDIATE v_update_query1 ;