Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Question ...
A copy of this was sent to narenn_at_my-deja.com
(if that email address didn't require changing)
On Mon, 21 Jun 1999 18:00:13 GMT, you wrote:
>I am stuck with this for a while. How do you declare
>something like this with the owner being a variable ?
>
>var-name owner.table.column%type;
>
>I wrote a procedure with above datatype. I don;t want to
>hardcode the table owner name in the script. How do i
>make the owner a variable ?
>
>In other words my problem is this. The procedure i need to
>compile access table's which are not owned by the user id
>i use to compile the procedure but has read permission to
>it. The only way i can access the table is like
>this, owner.table_name. eg : FC_RTE_A1.T_FIKA_KNOWNAFIID
>where FC_RTE_A1 is the owner and T_FIKA_KNOWNASFIID is
>the table name. I don;t want to hard code FC_RTE_A1 ie
>owner of the table because the ownership will change
>between various enviroments i need to compile this script
>in!
>
>Any ideas ? I looked through PL/SQL manual from Oracle. I
>could not find any way to do this ?
>
create a synonym for the objects instead.
SQL> create synonym table for owner.table;
That way, you just need to recreate the synonyms with different owners at a later date.
>Please e-mail me at narendra.nathmal_at_fmr.com if you
>have any suggestions.
>
>Thanks
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Fine Grained Access Control", added June 8'th
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Jun 21 1999 - 15:02:31 CDT