Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> DYNAMIC SQL AND BIND VARS.
I have the following bit of code that will be called a lot within a
package. Can anyone tell me if this is the making use of bind
variables?
FUNCTION F_GET_VAR_VALUE (LV_FIELD VARCHAR2
,LV_TABLENAME VARCHAR2
,LV_ROWSTAMP VARCHAR2)
RETURN VARCHAR2 IS LV_VALUE VARCHAR2(2000); BEGIN EXECUTE IMMEDIATE 'SELECT ' || LV_FIELD || ' FROM ' || LV_TABLENAME || ' WHERE ROWSTAMP = :ROWSTAMP' INTO LV_VALUE USING LV_ROWSTAMP; RETURN LV_VALUE; END F_GET_VAR_VALUE;
Is this the best way doing this?
Thanks in advance.
John Received on Thu Oct 10 2002 - 08:39:06 CDT