Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2002
    Location
    Germany
    Posts
    141

    Wink Unanswered: 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
    Last edited by RKrick; 05-14-04 at 04:57. Reason: The first version had a bug
    Rodney Krick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •