pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rui Pacheco <rep@devdomain.com>
To: pgsql-sql@postgresql.org
Subject: Some problems with (my?) PlSQL
Date: Tue, 4 Jun 2002 23:02:01 +0100
Message-ID: <034601c20c13$755ce790$1601a8c0@devdomain.com> (raw)

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@somehost.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?





view thread (3+ messages)  latest in thread

Message-ID: <034601c20c13$755ce790$1601a8c0@devdomain.com>
Permalink:  ../034601c20c13$755ce790$1601a8c0@devdomain.com/
Also on:    postgresql.org/message-id/034601c20c13$755ce790$1601a8c0@devdomain.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rep@devdomain.com
  Subject: Re: Some problems with (my?) PlSQL
  In-Reply-To: <034601c20c13$755ce790$1601a8c0@devdomain.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox