title: H2 database - How to access function created in another alias
body: <p>I am trying to replicate our database in H2 for testing purpose. I would like to create 2 functions and one of them depends on the other. The following codes are for oracle :</p>
  
  <p>GET_FULL_ADDRESS:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE OR REPLACE FUNCTION "GET_FULL_ADDRESS"
  (
      flat IN VARCHAR2,
      street IN VARCHAR2,
      district IN VARCHAR2,
      country_code IN VARCHAR2
  )
  RETURN VARCHAR2
  IS
  BEGIN
      RETURN flat || ', ' || street || ', ' || district || ', ' || CONVERT_COUNTRY_CODE(country_code);
  END;
  </code></pre>
  
  <p>CONVERT_COUNTRY_CODE:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE OR REPLACE FUNCTION "CONVERT_COUNTRY_CODE"
  (
      country_code IN VARCHAR2
  )
  RETURN VARCHAR2
  IS
  BEGIN
      CASE country_code
          WHEN 'UK' THEN RETURN 'United Kingdom';
          WHEN 'US' THEN RETURN 'United States';
          -- Skipping the rest of the cases...
          ELSE RETURN country_code;
      END CASE;
  END;
  </code></pre>
  
  <p>I tried to convert them for H2 with ALIAS</p>
  
  <p>GET_FULL_ADDRESS:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE ALIAS GET_FULL_ADDRESS AS '
      String getFullAddress(String flat, String street, String district, String country_code) {
          return flat + ", " + street + ", " + district + ", " + convertCountryCode(country_code);
      }
  ';
  </code></pre>
  
  <p>CONVERT_COUNTRY_CODE:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE ALIAS CONVERT_COUNTRY_CODE AS '
      String convertCountryCode(String country_code) {
          switch(country_code) {
              case "UK": return "United Kingdom";
              case "US": return "United States";
              // Skipping the rest of the cases...
              default: return country_code;
          }
      }
  ';
  </code></pre>
  
  <p>The above codes produce a "cannot find symbol" error</p>
  
  <pre><code>    convertCountryCode(country_code);
      ^
  symbol:   method convertCountryCode(String)
  location: class GET_FULL_ADDRESS
  </code></pre>
  
  <p>If I put the 2 functions into a single CREATE ALIAS statement it works, but both functions are referenced in my views so I need separated CREATE ALIAS statement.</p>
  
  <p>How can I call the function defined in other CREATE ALIAS statement?</p>