Cursor based records in PostgreSQL

前端 未结 2 1533
孤独总比滥情好
孤独总比滥情好 2020-12-06 00:51

I\'m trying to use cursors for a query that joins multiple tables. I\'ve seen that for oracle there is a cursor based record. When I try the same for Postgres, it throws som

2条回答
  •  孤城傲影
    2020-12-06 01:45

    Just use the RECORD type:

    DECLARE
        ...
        cur_row RECORD;
    BEGIN
        ...
        FETCH xyz INTO cur_row;
        EXIT WHEN NOT FOUND;
        IF cur_row.city LIKE 'CH%' THEN
            ...
    

提交回复
热议问题