Re: [SQL] sql query with join and parameter in postgresql function

2004-01-16 Thread Philippe Lang
> > I thought a view would be more appropriate, but > > if I'm not wrong, a view does not accept any parameter > > as input... > > But you can just define the view and select it with a WHERE clause with > your parameter, just like a normal table. Would that help? Thanks! That's perfect. I join in

Re: [SQL] sql query with join and parameter in postgresql function

2004-01-16 Thread Michael Glaesemann
On Jan 16, 2004, at 8:30 PM, Philippe Lang wrote: Hello, I'd like to write a function similar to that: CREATE FUNCTION public.report_join_parameter(char(6)) RETURNS ??? AS Do I ***HAVE TO*** define a composite type for the columns my function

[SQL] sql query with join and parameter in postgresql function

2004-01-16 Thread Philippe Lang
Hello, I'd like to write a function similar to that: CREATE FUNCTION public.report_join_parameter(char(6)) RETURNS ??? AS ' SELECT tableA.field1, tableA.field2, tableB.field1, tableB.field2, tableC.field1, tableC.field2, FROM tableA INNER JOIN

Re: [SQL] problem with function trigger

2004-01-16 Thread Christoph Haller
> > Hi I'm trying to update a table column with a pl/pgsql function and a > trigger. > But I didn't managed to make it work so far. > > Here's my function code : > > CREATE FUNCTION public.calcul_impact() RETURNS opaque AS ' > > DECLARE > id_line integer; > quantity integer; > single_price

Re: [SQL] Email function using c instead of tclu

2004-01-16 Thread Christoph Haller
> > Hi, > I have tried without any success to get this pgmail for tclu resolved. > Does anyone have or know of the same sort of function as pgmail but > supporting c, as this is one of the installed languages I have access > to under postgresql. So for instance: > > CREATE FUNCTION sendemail(x