Does Oracle have an equivalent of SQL Server's table variables?

前端 未结 4 449
闹比i
闹比i 2020-11-28 07:54

In SQL Server, you can declare a table variable (DECLARE @table TABLE), which is produced while the script is run and then removed from memory.

Does Ora

4条回答
  •  Happy的楠姐
    2020-11-28 08:46

    Yes it does have a type that can hold the result set of a query (if I can guess what TABLE does). From ask Tom: your procedure may look like this:

    procedure p( p_state in varchar2, p_cursor in out ref_cursor_type )
    is
    begin
        open p_cursor for select * from table where state = P_STATE;
    end;
    

    where p_cursor is like a table type. As has been already answered there are plenty of options for storing result sets in Oracle. Generally Oracle PL/SQL is far more powerful than sqlserver scripts.

提交回复
热议问题