Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Lew
Dale wrote: Hi, I've got some code which postgres 8.3.3 won't accept. Postgres doesn't like the INTO clause on RETURNING INTO and I've tried following the documentation. UPDATE EntityRelation SET Status = inStatus, Modified = Session_TimeStamp(), ModifiedBy = UserID() WHERE (RelationID =

[GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Dale
Hi, I've got some code which postgres 8.3.3 won't accept. Postgres doesn't like the INTO clause on RETURNING INTO and I've tried following the documentation. UPDATE EntityRelation SET Status = inStatus, Modified = Session_TimeStamp(), ModifiedBy = UserID() WHERE (RelationID = inRelationID) AND

Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Dale Harris
; pgsql-general@postgresql.org Subject: Re: [GENERAL] Re: can't get UPDATE ... RETURNING ... INTO ... to compile successfully Alvaro Herrera [EMAIL PROTECTED] writes: Bill Moran wrote: Is it possible that your UPDATE command is updating multiple rows? I don't believe RETURNING will work on an UPDATE

Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Tom Lane
Dale Harris [EMAIL PROTECTED] writes: In the following documentation it advises that the UPDATE statement should be able to return a value into a variable in plpgsql. http://www.postgresql.org/docs/8.3/static/plpgsql-statements.html It works for the INSERT command, but not UPDATE. As was

Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Klint Gore
Dale Harris wrote: It works for the INSERT command, but not UPDATE. For the INSERT command, it makes my code look neater and I image it's more efficient too. This time I am trying to UPDATE a field using a primary key, and return another field into a variable so that I can take necessary

Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Dale Harris
that far as the script fails to compile due to the INTO clause. Regards, Dale. -Original Message- From: Klint Gore [mailto:[EMAIL PROTECTED] Sent: Wednesday, 20 August 2008 12:47 To: Dale Harris Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] can't get UPDATE

Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Scott Marlowe
On Tue, Aug 19, 2008 at 9:51 PM, Dale Harris [EMAIL PROTECTED] wrote: As per the original message: UPDATE EntityRelation SET Status = inStatus, Modified = Session_TimeStamp(), ModifiedBy = UserID() WHERE (RelationID = inRelationID) AND (EntityID = inEnityID) AND IsEqual(inRelatedID,

Re: [GENERAL] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Klint Gore
Dale Harris wrote: As per the original message: I've got some code which postgres 8.3.3 won't accept. Postgres doesn't like the INTO clause on RETURNING INTO and I've tried following the documentation. UPDATE EntityRelation SET Status = inStatus, Modified = Session_TimeStamp(),