I have a function that has one parameter of a table type, i want to loop through all the fields and return the column that has a null or empty value.
CREATE OR REPLACE FUNCTION toned.function_validate(varmember tbl_member)
RETURNS text AS
$BODY$
...
The definition of tbl_member below
CREATE TABLE toned.tbl_member
(
code smallint NOT NULL DEFAULT nextval('toned.seq_code'::regclass),
name text NOT NULL,
email text,
address text,
city text,
country text
);
can anyone help me to loop through the variable? I dont know how to
refer to the field names.
can i do something like varmember[0] ??