title: db2 how to view the code User-Defined-Function calling C code
body: <p>I would like to see the code for a function defined like below. This function 
  -lives in a schema called <code>MYSCHEMA</code>
  -makes usage of a shared library installed.</p>
  
  <p>I tried to use the following but it doesn't work.</p>
  
  <pre><code>  select r.routinename as FunctionName, r.text as FunctionBody from 
    syscat.routines r where r.origin in ('U','R') and ROUTINESCHEMA='TRADE' 
    AND ROUTINETYPE ='F'
  </code></pre>
  
  <p>How can I do that?</p>
  
  <pre><code>   create or replace function MyFunction(varchar(60))
            returns  table(
            ..fields..
             )
            external name 'mySharedLib.so!function'
            language c
            parameter style sql
  </code></pre>