Background information

Currently, functions and PolarDB-O written in other languages are not supported in stored procedure.

Solutions

Use the SPL language supported by PolarDB-O, or PL/pgSQL supported by Postgresql to implement the corresponding business logic.

Examples

  • Functions implemented in JAVA:
    create or replace function foo return varchar is external language java name 'hello'
  • Rewrite the function as SPL syntax:
    CREATE OR REPLACE FUNCTION foo
        RETURN VARCHAR2
    IS
    BEGIN
        RETURN 'That''s All Folks!' ;
    END simple_function;

    For more information, see Create a function.

  • Or a function that overrides PL/pgSQL syntax:
    CREATE FUNCTION foo(integer, text) RETURNS integer
    AS 'function body text'
    LANGUAGE plpgsql;

    For more information, see Structure of PL/pgSQL.