sybase IQ 15.2

20 views
Skip to first unread message

Sharon Zzz

unread,
Nov 10, 2014, 5:07:10 PM11/10/14
to iq...@googlegroups.com
Hi,
 
I was trying to revoke truncate from an application user, hower, there seems to be no truncate in the revoke context.  I wonder if there is any way to revoke truncate permission on a table from all users?
 
thanks.
 
Sharon

Mark Mumy

unread,
Nov 10, 2014, 6:02:08 PM11/10/14
to iq...@googlegroups.com
What about just revoking delete?  They are identical in iq. 

Mark
 
========================

Sent from my mobile device
--
You received this message because you are subscribed to the Google Groups "iqug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iqug+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sharon Zzz

unread,
Nov 10, 2014, 9:48:23 PM11/10/14
to iq...@googlegroups.com
But delete will take much longer time than truncate, they are different command. delete can be rolled back, but truncate cannot be rolled back.  There will be no way to allow delete only then?
 
Sharon

Mark Mumy

unread,
Nov 10, 2014, 10:46:57 PM11/10/14
to iq...@googlegroups.com
That's not quite true for IQ.  What you describe fits perfectly well with ASE.

In IQ, however, a truncate and delete with no where clause are treated the same.  They perform the same and are controlled by full transactional control.


Take this script as an example:

drop table if exists trunctst
go
create table trunctst ( a1 int )
go
insert into trunctst values ( 1 )
go 10
select count(*) from trunctst
go
set temporary option chained='on';
begin
truncate table trunctst;
rollback;
end
go
set temporary option chained='off';
go
commit
go
select count(*) from trunctst
go


Immediately after the truncate command is a rollback.  When run, both select count(*) statements return 10, the number of rows in the table.

When the rollback is changed to a commit, the second select count(*) returns 0 because the truncate was committed.

Also, when you issue a "delete * from table", it is performed the same as if you did a "truncate table".

From the IQ 15.2 manuals:

TRUNCATE TABLE is equivalent to a DELETE statement without a WHERE clause


Mark

Sharon Zzz

unread,
Nov 10, 2014, 10:51:50 PM11/10/14
to iq...@googlegroups.com
I see, thank you! 
Reply all
Reply to author
Forward
0 new messages