Solved

db2 privileges

Posted on 2004-03-22
2
2,550 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Automate iSeries SFTP to a remote SFTP host 3 3,088
Call a stored proc from a VIEW 5 102
ODBC connect from ms access to DB2 3 102
Access Pass Through Query rounding off ending zeros 9 124
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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