title: Discover DB2 procedure default parameters using SYSCAT tables
body: <p>Like Oracle, DB2 supports parameter defaults in stored procedures. Oracle syntax:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE p_default (
    p_in_number   IN  number   := 0,
    p_out_number  OUT number,
    p_in_varchar  IN  varchar2 := '0',
    p_out_varchar OUT varchar2,
    p_in_date     IN  date     := date '1981-07-10',
    p_out_date    OUT date
  )
  </code></pre>
  
  <p>DB2 syntax:</p>
  
  <pre><code>CREATE PROCEDURE p_default (
    IN  p_in_number   INTEGER DEFAULT(0),
    OUT p_out_number  INTEGER,
    IN  p_in_varchar  VARCHAR(10) DEFAULT('0'),
    OUT p_out_varchar VARCHAR(10),
    IN  p_in_date     DATE DEFAULT('1981-07-10'),
    OUT p_out_date    DATE
  )
  </code></pre>
  
  <p>With Oracle, I can discover defaults using this query:</p>
  
  <pre><code>SELECT argument_name, defaulted FROM all_arguments WHERE object_id = :proc_id
  </code></pre>
  
  <p>How can I discover this in DB2 selecting from <code>SYSCAT</code> tables? I don't see any useful column in <code>SYSCAT.PROCPARMS</code> or <code>SYSCAT.FUNCPARMS</code>. Note, I don't mind calling any stored procedure from <code>SYSPROC</code> if such a procedure exists...</p>
  
  <p>Note, I have asked as similar question about SQL Server:</p>
  
  <p><a href="https://stackoverflow.com/questions/9838446/discover-sql-server-procedure-default-parameters-using-sys-or-information-schema">Discover SQL Server procedure default parameters using SYS or INFORMATION_SCHEMA tables</a></p>