2009-04-26 3 views

Antwort

2

Dies ist eine Art, wie ich herausgefunden:

cols_to_select := according to a set of rules, we get the name of the columns 

FOR I IN EXECUTE 'SELECT ARRAY['||cols_to_select||'] as AR FROM tabl' LOOP 
    -- how to access to fields of record I without knowing their names? 
    FOR j IN 1..array_upper(I.ar,1) LOOP 
    RAISE NOTICE '%', I.AR[j]; 
    END LOOP; 

END LOOP; 

Das Problem bei dieser Lösung ist, dass schlägt fehl, wenn die Spalten verschiedene Typen haben .

Verwandte Themen