[SQL] How to write cursors

2012-04-03 Thread La Chi
Hello everyone, i have created this function in which i simply want to display a column values through a cursor , but unfortunately i am not getting the column values , this function is showing me simple column name but not the  fields in column. CREATE OR REPLACE FUNCTION foo(id int) returns t

[SQL] Cursor Error

2012-04-03 Thread La Chi
Hello every one i have created this function to test cursors , but when i execute this funtion it give me this error , how can i fix this error CREATE OR REPLACE FUNCTION foo(custid int) returns table(userid int) as $BODY$ DECLARE rs cursor for Select customer_name from customer; BEGIN fetch f

Re: [SQL] Wrong output from union

2012-04-03 Thread Jasen Betts
On 2012-04-02, Gary Stainburn wrote: > Thanks for this David. > > Does anyone know why it too until Saturday for my post to appear on the listr? > > Gary If you haven't signed up for the mailing list with exactly the same email address that you post from the message will be held for moderation.

[SQL] Duplicate information in parent and child tables

2012-04-03 Thread JORGE MALDONADO
I have a parent table and a child table. In order to detect duplicate information I need to consider both tables. This means that a "duplicate record" consists of one parent record and one or more child records. Is there any standard approach to solve this issue? Respectfully, Jorge Maldonado

Re: [SQL] Duplicate information in parent and child tables

2012-04-03 Thread msi77
Maybe this will help http://sql-ex.ru/help/select18.php 04.04.2012, 02:03, "JORGE MALDONADO" : > I have a parent table and a child table. In order to detect duplicate > information I need to consider both tables. This means that a "duplicate > record" consists of one parent record and one or mor