ERROR: unexpected SELECT query in exec_stmt_execsql()

Поиск
Список
Период
Сортировка
От Branden R. Williams
Тема ERROR: unexpected SELECT query in exec_stmt_execsql()
Дата
Msg-id Pine.LNX.4.20.0008150857210.31566-100000@altair.kickinit.net
обсуждение исходный текст
Список pgsql-sql
Hi.  I am attempting to create a function to do some selects and return
some information.  Pretty straight forward.  No matter what I do, I always
get this error.  Here is my stored function and how I am calling it...

create function sp_list_categories(int4) returns varchar as '
DECLARE
        postid ALIAS FOR $1;
        parentid int4;
BEGIN

        SELECT * FROM category WHERE id = postid;
        parentid := SELECT parent FROM category WHERE id = postid;

        IF parentid ISNULL THEN
                RETURN
        ELSE
                SELECT sp_list_categories(parentid);
                RETURN name;
        END IF;

END;
' LANGUAGE 'plpgsql';


jimmydbase=# select sp_list_categories(20);
ERROR:  unexpected SELECT query in exec_stmt_execsql()

Any and all help would be appreciated!

Branden.



В списке pgsql-sql по дате отправления:

Предыдущее
От: Sandis
Дата:
Сообщение: Re[2]: data integrity
Следующее
От: Thomas Swan
Дата:
Сообщение: Re: 8K Limit, whats the best strategy?