Home > Archive > IQ Server > March 2006 > ownership chain or something else









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ownership chain or something else
Matej

2006-03-15, 1:25 pm

Hi, I have problem with ownerships of stored procedures and
tables. I'll show it on the example:

userA create table
create table userA.aaa(i int)

then create procedure
create procedure userA.sp1 as
select * from aaa
go

and grants execution to userB
grant execute on sp1 to userB

when userB tries to execute procedure error message raises
[Sybase][ODBC Driver][Adaptive Server Anywhere]Table
'/usr/users/sybiq/ASIQ-12_6/IQSRV/IQSRV.db.aaa' not found
procedure is executed, but no data are retrieved
when I use full table name in procedure then execution works
OK
create procedure userA.sp2 as
select * from userA.aaa
go

when I use temp table to "cache" data from table aaa
procedure works too:
create procedure userA.sp3 as
select * into #t from aaa
select * from #t
drop table #t
go

My question is: Why sp1 does not work? Who is db user? Is
there any SET option to allow it?

thanx for answer
John

2006-03-21, 8:33 pm

you need to grant select on table 'userA.aaa' to userB.

> Hi, I have problem with ownerships of stored procedures
> and tables. I'll show it on the example:
>
> userA create table
> create table userA.aaa(i int)
>
> then create procedure
> create procedure userA.sp1 as
> select * from aaa
> go
>
> and grants execution to userB
> grant execute on sp1 to userB
>
> when userB tries to execute procedure error message raises
> [Sybase][ODBC Driver][Adaptive Server Anywhere]Table
> '/usr/users/sybiq/ASIQ-12_6/IQSRV/IQSRV.db.aaa' not found
> procedure is executed, but no data are retrieved
> when I use full table name in procedure then execution
> works OK
> create procedure userA.sp2 as
> select * from userA.aaa
> go
>
> when I use temp table to "cache" data from table aaa
> procedure works too:
> create procedure userA.sp3 as
> select * into #t from aaa
> select * from #t
> drop table #t
> go
>
> My question is: Why sp1 does not work? Who is db user? Is
> there any SET option to allow it?
>
> thanx for answer

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com