pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Some problems with (my?) PlSQL
3+ messages / 2 participants
[nested] [flat]

* Some problems with (my?) PlSQL
@ 2002-06-04 22:02 Rui Pacheco <rep@devdomain.com>
  2002-06-04 22:18 ` Re: Some problems with (my?) PlSQL Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Rui Pacheco @ 2002-06-04 22:02 UTC (permalink / raw)
  To: 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@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?





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Some problems with (my?) PlSQL
  2002-06-04 22:02 Some problems with (my?) PlSQL Rui Pacheco <rep@devdomain.com>
@ 2002-06-04 22:18 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2002-06-04 23:26   ` Re: Some problems with (my?) PlSQL Rui Pacheco <rep@devdomain.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Stephan Szabo @ 2002-06-04 22:18 UTC (permalink / raw)
  To: Rui Pacheco <rep@devdomain.com>; +Cc: pgsql-sql

On Tue, 4 Jun 2002, Rui Pacheco wrote:

> 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"

Wierd that it would say $6.  You might be getting bitten by the changes to
timestamp.  Maybe using "timestamp"(strDateCreation) and
"timestamp"(strDateLastAccess) would make it work.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Some problems with (my?) PlSQL
  2002-06-04 22:02 Some problems with (my?) PlSQL Rui Pacheco <rep@devdomain.com>
  2002-06-04 22:18 ` Re: Some problems with (my?) PlSQL Stephan Szabo <sszabo@megazone23.bigpanda.com>
@ 2002-06-04 23:26   ` Rui Pacheco <rep@devdomain.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Rui Pacheco @ 2002-06-04 23:26 UTC (permalink / raw)
  To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: pgsql-sql

> > 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"
>
> Wierd that it would say $6.  You might be getting bitten by the changes to
> timestamp.  Maybe using "timestamp"(strDateCreation) and
> "timestamp"(strDateLastAccess) would make it work.

That's it! Thanks a lot for your tip! :)

Rui




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-06-04 23:26 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-04 22:02 Some problems with (my?) PlSQL Rui Pacheco <rep@devdomain.com>
2002-06-04 22:18 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-06-04 23:26   ` Rui Pacheco <rep@devdomain.com>

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