Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!newsfeed.news2me.com!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: JOHNA@PEACOCK-ENGINEERING.COM (John Alen)
Newsgroups: comp.databases.oracle.server
Subject: DYNAMIC SQL AND BIND VARS.
Date: 10 Oct 2002 06:39:06 -0700
Organization: http://groups.google.com/
Lines: 26
Message-ID: <69ad472f.0210100539.9c51b61@posting.google.com>
NNTP-Posting-Host: 217.199.161.43
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1034257146 19320 127.0.0.1 (10 Oct 2002 13:39:06 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 10 Oct 2002 13:39:06 GMT
Xref: newsfeed1.easynews.com comp.databases.oracle.server:163722
X-Received-Date: Thu, 10 Oct 2002 06:39:02 MST (news.easynews.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
