Solved

db2 privileges

Posted on 2004-03-22
2
2,529 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

11 Experts available now in Live!

Get 1:1 Help Now