Unix Technical Forum

No select privilege on sysibm.sysdummy1

This is a discussion on No select privilege on sysibm.sysdummy1 within the DB2 forums, part of the Database Server Software category; --> create table ppp ( t int ) @ create view v_ppp as select t from ppp @ select 1 ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 05:40 AM
Mike Gemmell
 
Posts: n/a
Default No select privilege on sysibm.sysdummy1

create table ppp
(
t int
)
@

create view v_ppp as
select t from ppp
@

select 1 from sysibm.sysdummy1
@

create trigger q
instead of insert on v_ppp
for each row
begin atomic
declare x int;
set x = (select 1 from sysibm.sysdummy1);
end@

With DB2 8 fp 7b, 8a I have been getting the following error when
creating the trigger in the above code

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0551N "CMM" does not have the privilege to perform operation
"SELECT" on
object "SYSIBM.SYSDUMMY1". LINE NUMBER=7. SQLSTATE=42501

The standalone select from sysibm.sysdummy1 works fine.

I did not have this problem with Fix Pack 7a.

Has anybody encountered this, should I even bother with downloading Fix
pack 9?

Mike

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 05:40 AM
Mike Gemmell
 
Posts: n/a
Default Re: No select privilege on sysibm.sysdummy1

That was ESE on Windows XP.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 05:40 AM
Mark A
 
Posts: n/a
Default Re: No select privilege on sysibm.sysdummy1

"Mike Gemmell" <greyeggsandspam@hotmail.com> wrote in message
news:1124399362.105218.150160@o13g2000cwo.googlegr oups.com...
> create table ppp
> (
> t int
> )
> @
>
> create view v_ppp as
> select t from ppp
> @
>
> select 1 from sysibm.sysdummy1
> @
>
> create trigger q
> instead of insert on v_ppp
> for each row
> begin atomic
> declare x int;
> set x = (select 1 from sysibm.sysdummy1);
> end@
>
> With DB2 8 fp 7b, 8a I have been getting the following error when
> creating the trigger in the above code
>
> DB21034E The command was processed as an SQL statement because it was
> not a
> valid Command Line Processor command. During SQL processing it
> returned:
> SQL0551N "CMM" does not have the privilege to perform operation
> "SELECT" on
> object "SYSIBM.SYSDUMMY1". LINE NUMBER=7. SQLSTATE=42501
>
> The standalone select from sysibm.sysdummy1 works fine.
>
> I did not have this problem with Fix Pack 7a.
>
> Has anybody encountered this, should I even bother with downloading Fix
> pack 9?
>
> Mike
>

I noticed some similarly strange behavior with FP8. I checked the privileges
on the view and noticed select on the view was not granted to public. Select
access is granted to public with databases created with FP4 and FP9 in my
shop.

First check the privileges on the view and grant select to public if not
already done. Also see APAR JR19986, which was supposed to have fixed the
problem in the following fixpacks (FP8 seems to be conspicuously absent from
the list):

Version 8 FixPak 7a
Version 8 FixPak 8a
Version 8 FixPak 9 (also known as Version 8.2 FixPak 2)
Version 8 FixPak 9a

Not sure if an upgrade of an existing db created in FP8 would fix the
problem.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 05:40 AM
Mike Gemmell
 
Posts: n/a
Default Re: No select privilege on sysibm.sysdummy1

Thanks Mark,

I was aware of that problem.

However, it turns out I didn't RTFM.
It appears that a user must be explicitly granted select (unless they
are a DBADM) on any tables or views referenced in any trigger they
create. No group privileges are considered in this context.

As for me not having the same symptoms on Fix Pack 7a, it turns out I
actually had DBADM privileges on the database I was using (arg).

Mike

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 05:40 AM
Brian Tkatch
 
Posts: n/a
Default Re: No select privilege on sysibm.sysdummy1

This is not an answer, just a suggestion.

Perhaps TABLE() would be better?

set x = (select 1 from TABLE(VALUES(1)) A)

sysibm.sysdummy1 was added for help in migrating Oracle code to DB2.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 05:40 AM
m0002a@yahoo.com
 
Posts: n/a
Default Re: No select privilege on sysibm.sysdummy1

Actually, it was added to maintain consistency with DB2 for z/OS.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com