Re: Accessing variable table names in Forms 4.5

From: Nick Butcher <nickb_at_btinternet.com>
Date: Fri, 04 Dec 1998 12:20:55 +0000
Message-ID: <3667D3A7.5F87_at_btinternet.com>


Brighton 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

The insufficient privileges message arises from the fact that you need a privilege EXPLICITLY granted in order to execute SQL statments via DBMS_SQL. e.g To create a table dynamically you will need to have that privilege (CREATE ANY TABLE) granted to you explicitly rather that via a role. To proceed with this you will need to get all of the privileges that you need granted to you and then bundle the code into a stored procedure so that it runs under your security domain, then grant execute privilege on your stored code to the form's users.

[Quoted] [Quoted] Alternately you can use the FORMS_DDL function but be aware that there are limitations with this.

DBMS_SQL is extremely useful & powerful and worth persevering with.

Regards

Nick Received on Fri Dec 04 1998 - 13:20:55 CET

Original text of this message