How to fetch to values from plpgsql function?

How to fetch to values from plpgsql function?

I’m trying to fetch to values from a plpgsql function with 2 OUT paramenters but I have some problem.

How to use function parameters in PL / pgSQL?

Within SQL statement we can call activity that a trigger performs or functions defined in PL/pgSQL. The OUT parameters are described as a part of the feature arguments listing and are returned as a component of the result. NOTE: The OUT parameters were supported since PostgreSQL version 8.1

How to create a procedure in PostgreSQL by example?

The following illustrates the basic syntax of the create procedure statement: First, specify the name of the stored procedure after the create procedure keywords. Second, define parameters for the stored procedure. A stored procedure can accept zero or more parameters.

Which is the procedural language for a stored procedure?

A stored procedure can accept zero or more parameters. Third, specify plpgsql as the procedural language for the stored procedure. Note that you can use other procedural languages for the stored procedure such as SQL, C, etc.

What are the parameter modes in PL / pgSQL?

The function changes the argument and returns the updated value. PL/pgSQL support three parameter modes: in, out, and intout. By default, a parameter takes the in mode. Use the in mode if you want to pass a value to the function. Use the out mode if you want to return a value from a function.

What makes up the body of a plpgsql function?

The basic make-up of a PLPGSQL function is as follows: There is the body which in modern versions of PostgreSQL (8+) the preferred encapsulation is dollar quoting vs. using a single quote Then there is a BEGIN END structure that defines the meat of the function.

Which is the in out mode in pgSQL?

The inout mode is the combination in and out modes. It means that the caller can pass an argument to a function. The function changes the argument and returns the updated value. PL/pgSQL support three parameter modes: in, out, and intout.