[SQL] multi results with functions

2004-05-31 Thread kasper
Hi

Im trying to make a stored procedure that returns * from at table, and
returns multible rows. Can you do that, and how?

basically I would like to do:

create or replace function test () returns record as '
 select * from dummytable;
' language sql;

Thanks
- Kasper



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[SQL] Trigger problem

2004-06-09 Thread kasper
Hi guys

Im tryint to make a trigger that marks a tuble as changed whenever someone
has updated it

my table looks something like this

create table myTable (
...
changed boolean;
)

now ive been working on a trigger and a sp that looks like this, but it
doesnt work...

create function myFunction returns trigger as '
begin
new.changed = true;
return new;
end;
' language 'plpgsql';

create trigger myTrigger
after update on lektioner
for each row
execute procedure myFunction();


the code compiles, runs, and doesnt whine about anything, but nothing
changes...

any ideas??

- Kasper



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])