Re: [SQL] Recursive function

2005-07-04 Thread Gnanavel Shanmugam
solved the problem. The modified function is CREATE or replace FUNCTION get_child_section_types(int) RETURNS setof int AS $$ declare v_section_type_id alias for $1; v_rec record; v_rec1 record; begi

[SQL] Recursive function

2005-07-04 Thread Gnanavel Shanmugam
Hi, I have a table with the following details. section_type_id | section_type_name | parent_section_type_id -+---+ 10 | Unit | 20 | Block | 10 30 | Prac

Re: [SQL] SELECT with sum on groups ORDERING by the subtotals

2005-06-16 Thread Gnanavel Shanmugam
100 | 0.9 |90 | 109 > 92110 | PRODUCT A |10 | 1.1 |11 | 120 > 92190 | PRODUCT b | 10 | 1.1 |11 | 11 > 92190 | PRODUCT b |10 | 1.1 |11 | 22 > 92190 | PRODUCT b |10 | 1.1 |11 | 33 >

Re: [SQL] Function does not return, but gives error..

2005-06-16 Thread Gnanavel Shanmugam
> -Original Message- > From: [EMAIL PROTECTED] > Sent: Thu, 16 Jun 2005 14:26:39 +0200 > To: pgsql-sql@postgresql.org > Subject: [SQL] Function does not return, but gives error.. > > I have the following function to determine wether or not a user is > member of a group, however I have a sma

Re: [SQL] SELECT with sum on groups ORDERING by the subtotals

2005-06-15 Thread Gnanavel Shanmugam
I think it will be better to add one more column for subtotal and write an "on before insert" trigger to update the subtotal with sum of total. with regards, S.Gnanavel > -Original Message- > From: [EMAIL PROTECTED] > Sent: Thu, 16 Jun 2005 00:56:42 -0300 > To: pgsql-sql@postgresql.org

Re: [SQL] rejecting characters in a field

2005-06-09 Thread Gnanavel Shanmugam
add check constraint with following pattern check(name !~ '[*/^#]') with regards, S.Gnanavel > -Original Message- > From: [EMAIL PROTECTED] > Sent: Thu, 9 Jun 2005 12:36:31 +0530 > To: pgsql-sql@postgresql.org > Subject: [SQL] rejecting characters in a field > > hi > i have a table wit