If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > TabAuth CRUD translation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-04, 08:03
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
Wink TabAuth CRUD translation

I've got this today on the Listserver. Maybe someone can use it here too.

SELECT substr(rtrim(bschema)||'.'||bname,1,30) as table,
substr(rtrim(pkgschema) || '.' || pkgname,1,18) as package,
CASE integer(mod(tabauth,32)/16) when 1 then 'C' else '-' end as C,
CASE integer(mod(tabauth,64)/32) when 1 then 'R' else '-' end as R,
CASE integer(mod(tabauth,128)/64) when 1 then 'U' else '-' end as U,
CASE integer(mod(tabauth,8)/4) when 1 then 'D' else '-' end as D
FROM syscat.packagedep;

(Txs to Alekos Papadopoulos and David Chapman)

And here the improved version (the first one has a "bug") from Nick F. Cianci:

SELECT substr(rtrim(bschema) || '.' || bname,1,28) as table
, substr(rtrim(pkgschema) || '.' || pkgname,1,16) as package
, CASE WHEN MOD(tabauth,32) in (16,20) THEN 'C' ELSE '-' END
|| CASE WHEN MOD(tabauth,64) in (32,52,48,36) THEN 'R' ELSE '-' END
|| CASE WHEN tabauth >= 64 THEN 'U' ELSE '-' END
|| CASE WHEN MOD(tabauth,16) = 4 THEN 'D' ELSE '-' END
as CRUD
FROM syscat.packagedep
__________________
Rodney Krick

Last edited by RKrick; 05-14-04 at 03:57. Reason: The first version had a bug
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On