Hi Albert,
Did you set up your function in a PocketQuery query or in your database itself? Please see my comment above: "The only requirement is that you define your Postgres function in your database directly (i.e. in your database tool) and not in PocketQuery."
If you have both the function and the select statement in one PocketQuery query, it won't work at all, because one query in PocketQuery must be exactly one statement.
Regards, Felix [Scandio]
Hi Felix,
I Appreciate your answer but your function returns text not a refcursor. Try to call this one:
CREATE OR REPLACE FUNCTION TEST_FUNCTION() RETURNS refcursor AS $$
DECLARE
result refcursor := 'Result Text';
BEGIN
RETURN result;
END;
$$ LANGUAGE plpgsql STRICT;
select TEST_FUNCTION();
Thank you,
Albert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Albert!
So I gave it a try and it works quite well. The only requirement is that you define your Postgres function in your database directly (i.e. in your database tool) and not in PocketQuery. For example, I added this function to my database via SquirrelSQL:
CREATE FUNCTION print_pocketquery (text) RETURNS TEXT AS ' BEGIN RETURN $1 || $1; END; ' LANGUAGE 'plpgsql';
This is my PocketQuery query:
SELECT print_pocketquery(:text);
In the macro browser, I enter this for the variable "text": "PocketQuery-Rocks!!"
Output is: "PocketQuery-Rocks!! PocketQuery-Rocks!! "
Let me know if you need further help!
Regards, Felix [Scandio]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the late reply! I will set up PocketQuery in a Postgres environment and write an answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.