Re: [GENERAL] cursors in postgres

2007-03-29 Thread A . M .
On Mar 29, 2007, at 10:47 , Jasbinder Singh Bali wrote: Hi, I've written a function using cursors as follows: can anyone please comment on the text in red. -- CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text, text, text)

Re: [GENERAL] cursors in postgres

2007-03-29 Thread Jasbinder Singh Bali
Actually I'm doing a duplicate check My function accepts 4 parameters. If all four exist in a particular row then i should not be inserting that record again. so is INSERT INTO table(a,b,c) SELECT 'a','b','c' WHERE NOT EXISTS ( SELECT * FROM table WHERE (a,b,c) = ('a','b','c') ); going to solve m

Re: [GENERAL] cursors in postgres

2007-03-29 Thread A.M.
On Mar 29, 2007, at 10:47 , Jasbinder Singh Bali wrote: Hi, I've written a function using cursors as follows: can anyone please comment on the text in red. -- CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text, text, text)

Re: [GENERAL] cursors in postgres

2007-03-29 Thread Filip RembiaƂkowski
2007/3/29, Jasbinder Singh Bali <[EMAIL PROTECTED]>: Hi, I've written a function using cursors as follows: can anyone please comment on the text in red. -- CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text, text, text) RETUR

[GENERAL] cursors in postgres

2007-03-29 Thread Jasbinder Singh Bali
Hi, I've written a function using cursors as follows: can anyone please comment on the text in red. -- CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text, text, text) RETURNS void AS $BODY$ DECLARE uid int4 ; src text;