Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as SQL by zeh ( 8 years ago )
CREATE OR REPLACE FUNCTION "administrativo"."popular_solicitacao_empenho_item_despesa"() RETURNS void AS
$BODY$
    DECLARE
        sei_record    RECORD;  
    BEGIN
        FOR sei_record IN select id, id_despesa
    from administrativo.solicitacao_empenho_item sei 
    where sei.id_despesa IS NOT NULL
        LOOP
    INSERT INTO administrativo.solicitacao_empenho_item_despesa
        (id, id_solicitacao_empenho_item, id_despesa)
     VALUES ( (SELECT NEXTVAL('administrativo.seq_solicitacao_empenho_item_despesa')),
      sei_record.id, sei_record.id_despesa);
        END LOOP;
    END
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

 

Revise this Paste

Your Name: Code Language: