[SQL] Help with Function in plpgsql

2010-12-19 Thread acurtis416
Hello Postgres Team My environment is 8.4.5 I use PGADMIN 1.10. I've written a function in which I'm having difficulty debugging to determine whether I have a logic error or what I'm attempting to do is not possible in plpgsql? Understand that I come from the Windows and Microsoft World. I'm use

Re: [SQL] help with function

2006-03-16 Thread Daniel Caune
> Hello, > > I have 2 tables where each table has a column named "comments" and the > tables are related as a one to many. I want to concatenate all the > comments of the many side to the one side so I wrote the following > plpgsql function to do so. > > > CREATE OR REPLACE FUNCTION fixcomment

Re: [SQL] help with function

2006-03-16 Thread Алексей Заяц
Hello > EXECUTE 'UPDATE sale SET comments = ' || Use PERFORM instead Alexey ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not

[SQL] help with function

2006-03-16 Thread lacou
Hello, I have 2 tables where each table has a column named "comments" and the tables are related as a one to many. I want to concatenate all the comments of the many side to the one side so I wrote the following plpgsql function to do so. CREATE OR REPLACE FUNCTION fixcomments() RETURNS

Re: [SQL] Help with function

2004-09-21 Thread Stephan Szabo
On Tue, 21 Sep 2004, CHRIS HOOVER wrote: > Thanks a bunch for the pointers and help. > > One other hopefully quick question. > > How do you query using a variable containing the query? > > I'm trying to build a select statment based upon what parameters are being > passed to the function. > > somt

Re: [SQL] Help with function

2004-09-21 Thread CHRIS HOOVER
" for Table_Rec in SQLStr loop return next Table_rec; end loop; return; end; Is this possible? Thanks again for any help, Chris --( Forwarded letter 1 follows )- Date: Mon, 20 Sep 2004 13:51:09 -0700 (PDT) To: chris.hoover Cc: [EMAIL PROTECTED] From: [

Re: [SQL] Help with function

2004-09-20 Thread Stephan Szabo
On Mon, 20 Sep 2004, CHRIS HOOVER wrote: > I need some help writing a simple function. > > Due to some program limitations for a program I run the db's for, I'm having > to write some simple functions to run some selects. However, I am not sure > how to have them correctly return the record(s) se

[SQL] Help with function

2004-09-20 Thread CHRIS HOOVER
I need some help writing a simple function. Due to some program limitations for a program I run the db's for, I'm having to write some simple functions to run some selects. However, I am not sure how to have them correctly return the record(s) selected and/or how to properly call them from sql.

Re: [SQL] Help with function optimisation

2002-07-10 Thread Tom Lane
"Ian Cass" <[EMAIL PROTECTED]> writes: > I've got a function that I run as a trigger to update a summary table on > insert to the main table. As you can see below, it does a select & an INSERT > if not found, or an UPDATE if found. This currently works OK, but I'd like > to improve performance by

[SQL] Help with function optimisation

2002-07-10 Thread Ian Cass
Hi, I've got a function that I run as a trigger to update a summary table on insert to the main table. As you can see below, it does a select & an INSERT if not found, or an UPDATE if found. This currently works OK, but I'd like to improve performance by removing the SELECT & attempting an UPDATE