Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> DYNAMIC SQL AND BIND VARS.

DYNAMIC SQL AND BIND VARS.

From: John Alen <JOHNA_at_PEACOCK-ENGINEERING.COM>
Date: 10 Oct 2002 06:39:06 -0700
Message-ID: <69ad472f.0210100539.9c51b61@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US