AUTHID in DB2

25 pts.
Tags:
AS/400 Authorization List
DB2 stored procedures
IBM DB2
I want to define AUTHID while create stored procedure in DB2/AS400.

This can be done in oracle as

CREATE OR REPLACE PROCEDURE PRC

AUTHID DEFINER / CURRENT_USER

can this also be done in iSeries AS/400 DB2?

 



Software/Hardware used:
AS400 iSeries

Answer Wiki

Thanks. We'll let you know when a new response is added.

Since no description has been supplied for what behavior is desired, I can only guess at what is really wanted.

From my limited understanding, “AUTHID DEFINER / CURRENT_USER” is better shown as:<pre>
AUTHID [ DEFINER | CURRENT_USER ]</pre>
The procedure is created so that it runs under the authorization ID of the DEFINER (creator) or the CURRENT USER.

My guess for DB2 on System i would be that the SET OPTION statement would be part of the procedure. The options to set would be DYNUSRPRF and/or USRPRF, depending on whether dynamic or static SQL is being affected. The DYNUSRPRF option can be set to *OWNER or *USER. The USRPRF option can be set to *OWNER, *USER or *NAMING.

It looks to me that the Oracle option is not only covered by DB2, but that DB2 allows more granularity and control.

But that’s a guess without feedback from the OP.

Tom

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Perhaps a description of what the purpose of AUTHID is in Oracle would help get a response? Maybe the DB2 users recognize it as something different. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    If the authid identifies who created the table then there is no need for that, all objects on the 400 have a created by field. Phil
    50,860 pointsBadges:
    report
  • Meandyou
    SET CURRENT SQLID = 'the id u want to use'; CREATE PROCEDURE ... ; This should work for your purposes.
    5,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following