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

Home -> Community -> Usenet -> c.d.o.server -> Re: Truncate and Synonyms !!

Re: Truncate and Synonyms !!

From: Joel R. Kallman <jkallman_at_us.oracle.com>
Date: Thu, 12 Nov 1998 13:11:59 GMT
Message-ID: <364ade3c.3192089@newshost.us.oracle.com>


On Thu, 12 Nov 1998 12:14:25 GMT, mhalpeth_at_my-dejanews.com wrote:

>Hi all !
>
>Just wondering why cant one use the 'Truncate Table' clause on a Synonym when
>all other operations like the delete / update et al are possible on the table
>via the synonym ?? Is it just because the 'Truncate' is a DDL and not a DML
>... but then doesnt the commands pointed to the synonyms get translated
>ultimately to the table (thats what the precomp has to do isnt it ?) !!
>
>Can anybody shine some light on this topic pls,...

You are correct in your assumption. Synonyms cannot have DDL performed against them. Synonyms are evaluated for DML statements only, such as DELETE, INSERT, UPDATE, and so forth. DDL statements do not evaluate the synonym so TRUNCATE and DROP will fail with the ORA-00942 error.   

The solution is to truncate the base table, either by connecting as the owner, or, if privilege is granted, by 'TRUNCATE TABLE USER.TABLE_NAME;'
>
>Thanks a lot !
>
>Mahesh .
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Thanks!

Joel

Joel R. Kallman Oracle Government, Education, & Health

Columbus, OH                             http://govt.us.oracle.com

jkallman@us.oracle.com                   http://www.oracle.com




The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. Received on Thu Nov 12 1998 - 07:11:59 CST

Original text of this message

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