Assuming I have the following procedure
CREATE PROCEDURE foo (table1_id IN TABLE1.table1_id%type,
table1_val IN TABLE1.table1_value%type)
AS
SQL_UPDATE VARCHAR2(500) := 'UPDATE TABLE1 SET table1_value =:1 WHERE table1_id = :2';
BEGIN
--.....
--1 :
EXECUTE IMMEDIATE SQL_UPDATE USING foo.table1_val, foo.table1_id;
--2 :
UPDATE TABLE1 SET table1_value = foo.table1_val WHERE table1_id = foo.table1_id;
END;
Beside the style/readability, is it any performance penalty for using dynamic query (1) compared to (2) in such cases (I mean when it's absolutely avoidable) ?
Thank you.