Some problems with (my?) PlSQL

From: "Rui Pacheco" <rep(at)devdomain(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Some problems with (my?) PlSQL
Date: 2002-06-04 22:02:01
Message-ID: 034601c20c13$755ce790$1601a8c0@devdomain.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I'm getting quite impressed with postgresql, but in the other end quite
disappointed with plpgsql...
I've been working successfully with postgresql 7.1.2, but I cannot use my
actual plpgsql in 7.2.1 (details bellow).

I wonder if there is already support for returning a rowset directly
(without that return cursor pointer workaround)?

Thanks in advance.

Rui

Parser error with many arguments:

----- example code:
DROP FUNCTION devUsersUpdate (INTEGER, VARCHAR, VARCHAR, VARCHAR, VARCHAR,
VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR);
CREATE FUNCTION devUsersUpdate (INTEGER, VARCHAR, VARCHAR, VARCHAR, VARCHAR,
VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR)
RETURNS INTEGER AS '
DECLARE

intId ALIAS FOR $1;
strLogin ALIAS FOR $2;
strPassword ALIAS FOR $3;
strEmail ALIAS FOR $4;
strTitle ALIAS FOR $5;
strFirstName ALIAS FOR $6;
strLastName ALIAS FOR $7;
strDateCreation ALIAS FOR $8;
strDateLastAccess ALIAS FOR $9;
strAccLocked ALIAS FOR $10;
strAccDisabled ALIAS FOR $11;
strPasswdChallenge ALIAS FOR $12;
strPasswdChallengeResponse ALIAS FOR $13;

BEGIN

UPDATE TS_USERS SET
LOGIN = strLogin, EMAIL = strEmail, TITLE = strTitle, FIRST_NAME =
strFirstName,
LAST_NAME = strLastName, DATE_CREATION = TIMESTAMP (strDateCreation),
DATE_LAST_ACCESS = TIMESTAMP (strDateLastAccess), ACC_LOCKED =
strAccLocked,
ACC_DISABLED = strAccDisabled, PASSWD_CHALLENGE = strPasswdChallenge,
PASSWD_CHALLENGE_RESPONSE = strPasswdChallengeResponse
WHERE ID = intId;

RETURN 1;
END;
' LANGUAGE 'plpgsql';
-------

While not reaching the limit of arguments, this function, when called, gives
me this error:

Query error [SELECT devUsersUpdate ('1', 'root', '', 'root(at)somehost(dot)com',
'', 'Super', 'User', '0001-01-01', '0001-01-01', 'N', 'N', '', '')]: ERROR:
parser: parse error at or near "$6"

which, by the way, didn't happened in postgresql 7.1.2...

Anyone had this problem or knows the answer to it?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-06-04 22:18:19 Re: Some problems with (my?) PlSQL
Previous Message Jean-Luc Lachance 2002-06-04 21:38:19 Re: Updating a table from another table