1 CREATE PROCEDURE test_proc1()
7 CREATE PROCEDURE test_proc2()
13 CREATE TABLE test1 (a int);
14 CREATE PROCEDURE test_proc3(x int)
17 spi_exec_query("INSERT INTO test1 VALUES ($_[0])");
27 CREATE PROCEDURE test_proc5(INOUT a text)
31 return { a => "$a+$a" };
33 CALL test_proc5('abc');
39 CREATE PROCEDURE test_proc6(a int, INOUT b int, INOUT c int)
43 return { b => $b * $a, c => $c * $a };
45 CALL test_proc6(2, 3, 4);
52 CREATE PROCEDURE test_proc9(IN a int, OUT b int)
56 elog(NOTICE, "a: $a, b: $b");
57 return { b => $a * 2 };
60 DECLARE _a int; _b int;
63 CALL test_proc9(_a, _b);
64 RAISE NOTICE '_a: %, _b: %', _a, _b;
68 NOTICE: _a: 10, _b: 20
69 DROP PROCEDURE test_proc1;
70 DROP PROCEDURE test_proc2;
71 DROP PROCEDURE test_proc3;