Re: Accessing variable table names in Forms 4.5

From: <stevec_at_zimmer.csufresno.edu>
Date: Wed, 02 Dec 1998 16:48:05 GMT
Message-ID: <743r04$teo$1_at_nnrp1.dejanews.com>


In article <742vua$ujf$1_at_newsreader1.core.theplanet.net>,   "Brighton" <someone_at_anywhere.com> wrote:
> Does anyone know how I could do the following in PL/SQL with Forms 4.5?
>
> select ename from tablename
>
> where tablename is a variable, that contains the name of a valid table?
>
> Whenever I try and do this, with for example select ename from :tbl_nme, the
> PL/SQL compiler rejects this.
>
> I've tried the DBMS_SQL.EXECUTE(....) command but whenever I run this, even
> from the SYS account, it says I have insufficient privelidges. Does anyone
> know
> a simpler workaround?
>
> Many thanks
> mrittman_at_tmf-europe.com

Using DBMS_SQL is the only way to access different tables from a form. I don't know why you are getting the insufficient privileges message -- it should work, unless the command you are executing does something you don't have privileges to do.

Try my QA utility form from my web site -- it uses DBMS_SQL to access the various tables. So if it works, then you should be able to do something similar in your form.

Also, your command, select ename from :tbl_name may need to be written:   'select ename from '||:block.tbl_name

Note the use of quotes and concatenation.

Steve Cosner
http://members.aol.com/stevec5088

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Dec 02 1998 - 17:48:05 CET

Original text of this message