How to get stored procedure definition?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jagger

    How to get stored procedure definition?

    On a remote system I got a stored procedure named MY_STORED_PROCE DURE.
    However there is a problem because I am not sure of the interface of
    it (number of
    parameters and types of them). I have googled, read documentation but
    I haven't
    found an appropriate syntax for quering database for description of
    already created
    stored procedure.

    Does such statement exist? If it exists does someone know how it
    should look
    like?

    --
    Best regards
    Jagger
  • Otto Carl Marte

    #2
    Re: How to get stored procedure definition?

    The system catalog is your friend :-)

    select text from syscat.ROUTINES where
    routinename='MY _STORED_PROCEDU RE'

    or for parameter specific info:

    select * from syscat.ROUTINEP ARMS where
    routinename='MY _STORED_PROCEDU RE'

    Jagger wrote:
    On a remote system I got a stored procedure named MY_STORED_PROCE DURE.
    However there is a problem because I am not sure of the interface of
    it (number of
    parameters and types of them). I have googled, read documentation but
    I haven't
    found an appropriate syntax for quering database for description of
    already created
    stored procedure.
    >
    Does such statement exist? If it exists does someone know how it
    should look
    like?
    >
    --
    Best regards
    Jagger

    Comment

    • Mark A

      #3
      Re: How to get stored procedure definition?

      "Jagger" <Pawel.Jagus@gm ail.comwrote in message
      news:8d0a6c4b-3897-4ac7-a198-95be7b93366c@a1 g2000hsb.google groups.com...
      On a remote system I got a stored procedure named MY_STORED_PROCE DURE.
      However there is a problem because I am not sure of the interface of
      it (number of
      parameters and types of them). I have googled, read documentation but
      I haven't
      found an appropriate syntax for quering database for description of
      already created
      stored procedure.
      >
      Does such statement exist? If it exists does someone know how it
      should look
      like?
      --
      Best regards
      Jagger
      In addition to the other suggestions, can do a db2look on the database. Of
      course you will get all the packages if you use the option to get DDL for
      SP's.


      Comment

      • Jagger

        #4
        Re: How to get stored procedure definition?

        On 5 Cze, 16:39, Otto Carl Marte <Otto.Ma...@gma il.comwrote:
        The system catalog is your friend :-)
        >
        select text from syscat.ROUTINES where
        routinename='MY _STORED_PROCEDU RE'
        >
        or for parameter specific info:
        >
         select * from syscat.ROUTINEP ARMS where
        routinename='MY _STORED_PROCEDU RE'
        Hi, Otto,

        this solution looks really reasonable, however
        I have problems with executing the query. Each
        time I get

        DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC:
        SYSCAT.TABLES.

        Even for such a simple query as
        SELECT count(*) FROM syscat.tables
        I get the same error code.

        The database that I am connecting to is said to be:

        Database product name: DB2
        Database product version: DSN08015 (DB2 v8 for z/OS)

        The above information is taken from the trace
        of the connection. I use JDBC connectivity

        Driver name: IBM DB2 JDBC Universal Driver Architecture

        --
        Best regards
        Jagger

        Comment

        Working...