,cycles.sname%TYPE ,cycles.tdate%TYPE) RETURNS INT LANGUAGE plpgsql SECURITY DEFINER AS''... ---------------------- -------------------------------------------- BTW,如果我写的: CREATE FUNCTION _makestats(cycles.sname%TYPE ,cycle%ROWTYPE ,cycles.sname%TYPE ,cycles.tdate%TYPE) 我总是得到: 错误:解析器:解析错误在或接近%在角色81 谢谢。 Karl< ko*@meme.com> 自由软件:你不要不付钱,你付清。 - Robert A. Heinlein ------------ ---------------(播出结束)--------------------------- 提示6:您是否搜索了我们的列表档案? http ://archives.postgresql.org Hi, Thought perhaps some other eyes than mine can tell if I''m doingsomething wrong here or if there''s a bug somewhere. I''ve neverpassed a ROWTYPE varaible to a function but I don''t see wherethe problem is. I keep getting errors like (the first is my debug output):NOTICE: last cycle is: 11WARNING: Error occurred while executing PL/pgSQL functionrebuild_cyclestatsWARNING: line 69 at assignmentERROR: Attribute "last_cycle" not found (Line number is off as I''ve snipped out code to post here.) $ psql --versionpsql (PostgreSQL) 7.3.4$ rpm -q postgresqlpostgresql-7.3.4-3.rhl9$ cat /etc/redhat-release Red Hat Linux release 9 (Shrike) (I don''t know how to query the server for it''s version number,I assume it''s in sync with the client.)-------------------------------------------------CREATE FUNCTION rebuild_cyclestats(cycles.sname%TYPE)RETURNS INTLANGUAGE plpgsqlSECURITY DEFINERAS ''DECLAREthis_sname ALIAS for $1; last_cycle cycles%ROWTYPE;this_cycle cycles%ROWTYPE;this_statdate biograph.statdate%TYPE; BEGIN SELECT INTO last_cycle * FROM cycles WHERE sname = this_snameAND seq = 1;IF NOT FOUND THEN-- There are no cycles. Do nothing.RETURN 0;END IF; -- debugraise notice ''''last cycle is: %'''', last_cycle.cid; -- The female''''s last cycle continues to her statdate.SELECT INTO this_statdate statdate FROM biograph WHERE sname =this_sname;--error is herePERFORM _makestats(this_sname, last_cycle, NULL, this_statdate); RETURN 0;END;''; CREATE FUNCTION _makestats(cycles.sname%TYPE, cycles, cycles.sname%TYPE, cycles.tdate%TYPE)RETURNS INTLANGUAGE plpgsqlSECURITY DEFINERAS '' ...------------------------------------------------------------------BTW, if I write: CREATE FUNCTION _makestats(cycles.sname%TYPE, cycles%ROWTYPE, cycles.sname%TYPE, cycles.tdate%TYPE) I always get:ERROR: parser: parse error at or near "%" at character 81Thanks. Karl <ko*@meme.com>Free Software: "You don''t pay back, you pay forward."-- Robert A. Heinlein ---------------------------(end of broadcast)---------------------------TIP 6: Have you searched our list archives? http://archives.postgresql.org 推荐答案 psql --version psql (PostgreSQL)7.3.4 psql --versionpsql (PostgreSQL) 7.3.4 rpm -q postgresql postgresql-7.3.4-3.rhl9 rpm -q postgresqlpostgresql-7.3.4-3.rhl9 cat / etc / redhat-release Red Hat Linux发行版9(Shrike) (我不知道如何查询服务器''版本号, 我假设它与客户同步。) ----------------- -------------------------------- CREATE FUNCTION rebuild_cycl estats(cycles.sname%TYPE) RETURNS INT LANGUAGE plpgsql 安全定义器 AS'' DECLARE this_sname ALIAS for cat /etc/redhat-release Red Hat Linux release 9 (Shrike) (I don''t know how to query the server for it''s version number,I assume it''s in sync with the client.)-------------------------------------------------CREATE FUNCTION rebuild_cyclestats(cycles.sname%TYPE)RETURNS INTLANGUAGE plpgsqlSECURITY DEFINERAS ''DECLAREthis_sname ALIAS for 这篇关于Ploggsql问题传递ROWTYPE函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-25 10:03