Question about Queries

From: <mrdjmagnet_at_aol.com>
Date: Wed, 24 Dec 2008 09:44:43 -0800 (PST)
Message-ID: <506da0b8-7c19-452a-90cb-5afbed98e546@c36g2000prc.googlegroups.com>

Hi,

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

Original text of this message