Solved

db2 privileges

Posted on 2004-03-22
2
2,542 Views
Last Modified: 2008-02-01
hi

how do i grant execute permission for stored procedure in db2

db2> grant execute on schemaname.spname to user xyz

i am getting SQL0204N  "schema.spname" is an undefined name.  SQLSTATE=42704

db2 >grant execute on package schemaname.spname to user xyz

i am getting SQL0204N  "schema.spname" is an undefined name.  SQLSTATE=42704

db2 > select procname from syscat.procedures where procschema='schemaname'
i am able to see the procedure.

how do i grant execute (or any) permission on stored procedure to an user

thanks
banu
0
Comment
Question by:banumaran
2 Comments
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 10660877
try

Select 'Grant EXEC on "' concat ProcShema concat '"."' concat procname
 concat '" to XYZ ' from syscat.procedures
 where procshema='schemaname'
order by 1

is the USER before xyz required?

which OS & UDB version?
0
 
LVL 13

Accepted Solution

by:
ghp7000 earned 125 total points
ID: 10663999
the stored procedure can be executed by anybody with privileges to the object(s) that the stored procedure references-you only grant execute on packages, not Sp's.

If the authorization ID has insufficient authority to perform the operation, an error (SQLSTATE 42502) is raised.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now