ma che vuol dire quel "order by 1"?
m.
Enrico wrote:
Problema vorrei creare una funzione che mi restituisca la setof di due campi è possible?
Cioè se scrivo:
CREATE OR REPLACE FUNCTION f (int4,int8) RETURNS SETOF table1 AS '
select AB.*
from table1 AB inner join table2 B on AB.campo=B.campo
where B.campo2 = $1
and AB.campo1 < $2
order by 1;
' LANGUAGE SQL
va tutto ok.Iil problema è che table1 ha supponiamo 10 campi e a me interessa che la query che mi ritorni solo due campi, per interderci vorrei fare qualcosa del genere:
CREATE OR REPLACE FUNCTION f (int4,int8) RETURNS SETOF qualcosa AS '
select AB.campo1,AB.campo2
from table1 AB inner join table2 B on AB.campo=B.campo
where B.campo2 = $1
and AB.campo1 < $2
order by 1;
' LANGUAGE SQL
esiste un tipo predefinito per fare questa cosa oppure un modo per creare un tipo composito ?
Enrico
_______________________________________________
Postgresql-it mailing list
Postgresql-it@xxxxxxxxxxxxxxxxx
http://www.linuxtime.it/mailman/listinfo/postgresql-it