HINT: If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT: PL/pgSQL function q1(integer) line 6 at SQL statement
In my q1 function I declared a variable roomrec RoomRecord.
I have sql queries select count(*) into roomrec.valid_room_number from ... where ... and select count(*) into roomrec.bigger_room_number from ... where ... and at the end of the function I return roomrec.
I don't understand why I keep getting "query has no destination for result data" when I specified the destination to be roomrec.valid_room_number and roomrec.bigger_room_number. I know that my sql queries are valid because I tested them and got the correct numbers, but when I put everything into a function I kept getting the error message. If anyone could point out a suggestion or know if I'm missing something, that would be really helpful. I tried not to post my whole queries here, but if that made it impossible to tell my mistakes I'd stop by at the lab instead.
Thanks in advance!
Paula