Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Truncate and Synonyms !!
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