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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Basic syntax question regarding SUBTYPE statement

Re: Basic syntax question regarding SUBTYPE statement

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 14 Jun 1999 14:02:18 GMT
Message-ID: <376a0b5a.6840125@newshost.us.oracle.com>


A copy of this was sent to James Knowles <kaa_at_xmission.com> (if that email address didn't require changing) On Mon, 14 Jun 1999 13:46:14 +0000, you wrote:

>
>Sorry for these basic questions....
>
>I can do the following without a problem:
>
>CREATE OR REPLACE PACKAGE TestPackage AS
>SUBTYPE t_Test IS table1.col1%TYPE;
>END TestPackage;
>
>However, the following fails. Is there some way to do this, or is it
>illegal? I cannot find an answer in ORACLE8 PL/SQL Programming. I'm
>connected as user1. If it's not allowed, is there some way around it?
>
>CREATE OR REPLACE PACKAGE TestPackage AS
>SUBTYPE t_Test IS user2.table1.col1%TYPE;
>END TestPackage;
>
>Thanks!

roles are never enabled during the execution of a procedure.

Try this:

SQL> set role none;
SQL> "statement you want to test to see if it'll work in a procedure"

If you can do it in plus with no roles you can do it in a procedure. If you can't, you must have the privelege from a role and hence won't be able to do it in a procedure.

You probably have the privelege to do what you are trying to do in the procedure via a role. Grant the privelege directly to the owner of the procedure and it'll work.

grant select on user2.table1 to user1;

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/

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 14 1999 - 09:02:18 CDT

Original text of this message

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