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: Truncating Within Procedures

Re: Truncating Within Procedures

From: Stewart Burnett <Stewart_at_burnettms.nospam.demon.co.uk>
Date: Fri, 9 Oct 1998 14:43:30 +0100
Message-ID: <6vl3tt$bm8$1@hagen.cloud9.co.uk>


There is a utility in dbms_utility (dbmsutil.sql creates this package) which will resolve a name

I've copied part of the package spec;

  procedure name_resolve(name in varchar2, context in number,     schema out varchar2, part1 out varchar2, part2 out varchar2,     dblink out varchar2, part1_type out number, object_number out number);

esiyuri_at_my-dejanews.com wrote in message <6vl17a$5eu$1_at_nnrp1.dejanews.com>...

>In article <6vk7n7$49i$1_at_nnrp1.dejanews.com>,
>  jflipse_at_spacestar.com wrote:
>> I am able to truncate tables within a stored procedure by passing the
>> table name (mytable) to a procedure which performs the truncate
>> :
>> :
>> I have no problems when the table name is explicitly called out, but
>> run into problems when the table name is a synonym.  I've tried to
>> bind the synonym to a variable and pass this to the procedure...
>
>John,
>
>the basic problem is that you can not use "truncate table" on a synonym.
To
>get around this you could always convert the synonym name into the actual >table name by checking ALL_SYNONYMS. Bear in mind that there may be further
>complications if the synonym "points" to another synonym, or a view, or a
>table that is owned by another user.
>
>If the truncate is being done in a stored procedure you will also have to
>ensure that the owner of the procedure has the required privs to truncate
the
>table.  Unless the table owned by the same user, these need to be granted
>directly rather than through a role.
>
>--
>Regards
>Yuri McPhedran
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own


Received on Fri Oct 09 1998 - 08:43:30 CDT

Original text of this message

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