Subject | Re: Optimizing a query |
---|---|
Author | vladman992000 |
Post date | 2006-12-04T15:21:24Z |
> SELECT FIRST (:A_ROW_COUNT) SKIP (:A_POSITION) .....I guess this leads me to another question about this... Is there a
way to use the parentheses ( ) to allow a variable to be inserted in a
SELECT statement?
For example, in the same SP I have a query that, depending on
parameters passed, may or may not limit the result set. For example:
RECORD_LIST_GET_PRC(A_FIRST, A_SKIP)
could have some code in it like this:
IF (A_FIRST IS NULL) then
V_LIMIT_CLAUSE = '';
ELSE
V_LIMIT_CLAUSE = 'FIRST '||A_FIRST||' SKIP '||A_SKIP;
Then inside the stored procedure, I'd like to refer to this variable
like this:
SELECT (:V_LIMIT_CLAUSE) * FROM TABLE
Will that work?
Myles