I should read the documentation carrefully .. Yes, you're right, Richard.
Many thanks to all.
Best,
Loredana
Loredana Curugiu wrote:
CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF
reminder_services AS'
DECLARE r reminder_services%ROWTYPE;
BEGIN
PERFORM dblink_connect(''dbname=''||$1);
PERFORM dblink_disconnect($1);
RETURN;
END;
' LANGUAGE plpgsql;
Now I get the er
CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF
reminder_services AS'
DECLARE r reminder_services%ROWTYPE;
BEGIN
PERFORM dblink_connect(''dbname=''||$1);
FOR r IN SELECT * FROM dblink(''SELECT * FROM reminder_services'')
AS columns( uid INT,
Loredana Curugiu wrote:
I created the following function
CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF
reminder_services AS'
DECLARE r reminder_services%ROWTYPE;
BEGIN
SELECT dblink_connect(''dbname=''||$1);
^^^
and I get th
I created the following function
CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF
reminder_services AS'
DECLARE r reminder_services%ROWTYPE;
BEGIN
SELECT dblink_connect(''dbname=''||$1);
FOR r IN SELECT * FROM dblink(''SELECT * FROM reminder_services'')
What Pavel mentions might indeed be an issue, but I think there's another one
too.
I think you have to call your function giving more information to the statement
on what types will be returned.
Since you use dblink I assume that the table or view reminder_services you
are basically selecting fr
Hello
Every SELECT statement in PL/pgSQL have to be forward to variables. In
plpgsql you can you use select only like
select into variables columns from ...
propably better version is (i haven't installed dblink and can't to test it)
CREATE OR REPLACE FUNCTION GetReminderServices( varchar ) RE
Hi everybody,
I created the following function:
CREATE OR REPLACE FUNCTION GetReminderServices( varchar ) RETURNS SETOF
reminder_services AS'
BEGIN
SELECT dblink_connect(''dbname=''||$1);
SELECT * FROM dblink(''SELECT * FROM reminder_services'')
AS reminder_services( uid INT,