Question about Queries
Date: Wed, 24 Dec 2008 09:44:43 -0800 (PST)
2 questions here:
First, in terms of minimizing the number of parse/execute calls, it is suggested to use bind variables. However, why would a statement like: "SELECT address FROM emp WHERE name = 'John Doe';" get reparsed ? The statement is always the same, and never changes.
Or, "SELECT product_name FROM product WHERE product_id = v_id AND status = 'Active';"
There, v_id is a variable and 'Active' is a literal, never changing.........so, why get re-parsed when it can re-use the statement?
Second, is using EXECUTE IMMEDIATE for doing a SELECT faster than a normal coded SELECT?
Much Thanks! Received on Wed Dec 24 2008 - 11:44:43 CST