Re: [GENERAL] PERFORM statement

2013-07-09 Thread Raymond O'Donnell
On 09/07/2013 05:20, Mike Christensen wrote: > I was reading about Postgres stored procs in the FAQ: > > https://wiki.postgresql.org/wiki/FAQ#Does_PostgreSQL_have_stored_procedures.3F > > It claims that an alternative syntax to: > > SELECT theNameOfTheFunction(arg1, arg2); > > Is: > > PERFORM

Re: [GENERAL] PERFORM statement

2013-07-08 Thread Mike Christensen
Ah ok that makes sense. The FAQ wasn't exactly clear about that. On Mon, Jul 8, 2013 at 9:38 PM, Tony Theodore wrote: > > On 09/07/2013, at 2:20 PM, Mike Christensen wrote: > > > PERFORM MyInsert(1,101,'2013-04-04','2013-04-04',2,'f' ); > > I get the error: > > ERROR: syntax error at or near "

Re: [GENERAL] PERFORM statement

2013-07-08 Thread Tony Theodore
On 09/07/2013, at 2:20 PM, Mike Christensen wrote: > > PERFORM MyInsert(1,101,'2013-04-04','2013-04-04',2,'f' ); > > I get the error: > > ERROR: syntax error at or near "PERFORM" > SQL state: 42601 > Character: 1 > > Is the FAQ out of date or was this feature removed? I'm using 9.2.1. Thank

[GENERAL] PERFORM statement

2013-07-08 Thread Mike Christensen
I was reading about Postgres stored procs in the FAQ: https://wiki.postgresql.org/wiki/FAQ#Does_PostgreSQL_have_stored_procedures.3F It claims that an alternative syntax to: SELECT theNameOfTheFunction(arg1, arg2); Is: PERFORM theNameOfTheFunction(arg1, arg2); However, when I try the followin

Re: [GENERAL] PERFORM statement inside procedure

2004-04-07 Thread Richard Huxton
On Wednesday 07 April 2004 08:30, Rajat Katyal wrote: > Actually my problem is PERFORM is not updating the FOUND variable to false > even when my query return no rows. Can you please tell me the better way to > use PERFORM so that by running my select query I just come to know whether > it returns

Re: [GENERAL] PERFORM statement inside procedure

2004-04-07 Thread Rajat Katyal
- From: "Tom Lane" <[EMAIL PROTECTED]> To: "Rajat Katyal" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 11:15 AM Subject: Re: [GENERAL] PERFORM statement inside procedure > "Rajat Katyal" <[EMAIL

Re: [GENERAL] PERFORM statement inside procedure

2004-04-06 Thread Tom Lane
"Rajat Katyal" <[EMAIL PROTECTED]> writes: > checkPKSql := ''select * from "transform_customer_billing" ''; > checkPKSql := checkPKSql || '' where "inv_no" = '' || quote_literal(new= > ."inv_no"); > PERFORM checkPKSql; You seem to be confusing PERFORM with EXECUTE. They are very different. The a

Re: [GENERAL] PERFORM statement inside procedure

2004-04-06 Thread Bill Moran
Rajat Katyal wrote: Hi: In postgres documentation its written that if we execute query as PERFORM /query /inside our stored procedure/;/ *then the special variable FOUND is set to true if the query produced at least one row, or false if it produced no rows.* ** But FOUND variable is always re

[GENERAL] PERFORM statement inside procedure

2004-04-06 Thread Rajat Katyal
Hi:   In postgres documentation its written that if we execute query as PERFORM query inside our stored procedure; then the special variable FOUND is set to true if the query produced at least one row, or false if it produced no rows.   But FOUND variable is always returning true even my qu