return multiple rows
От | Rakotomandimby Mihamina |
---|---|
Тема | return multiple rows |
Дата | |
Msg-id | 4AAA6480.5020003@gulfsat.mg обсуждение исходный текст |
Ответы |
Re: return multiple rows
Re: return multiple rows |
Список | pgsql-general |
Hi all, I have a FUNCTION queried like this: SELECT * FROM f_authorize_check_query2('%{SQL-User-Name}','%{User-Password}' [...]; Built this way: CREATE FUNCTION f_authorize_check_query2(...) RETURNS radcheck AS $_$ DECLARE [...] v_ret radcheck%ROWTYPE; [...] SELECT INTO v_ret '111',username,'Cleartext-Password',pwd,':=' FROM [...] RETURN v_ret; END; $_$ LANGUAGE plpgsql; It returns only one row, like this: +----+----------+--------------------+----+-------+ | id | UserName | Attribute | op | Value | +----+----------+--------------------+----+-------+ | 1 | bartek | Cleartext-Password | := | 1234 | +----+----------+--------------------+----+-------+ I would like it to return +----+----------+--------------------+----+-------+ | id | UserName | Attribute | op | Value | +----+----------+--------------------+----+-------+ | 1 | bartek | Cleartext-Password | := | 1234 | | 3 | bartek | Simultaneous-Use | := | 1 | +----+----------+--------------------+----+-------+ *But*, I would like to _hardcode_ the "Simultaneous-Use" row. If I use a FUNCTION to build the "Cleartext-Password" row, it's because the data structure could not have been feetched simply. Is SELECTing INTO a second time OK? -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 29 155 34
В списке pgsql-general по дате отправления: