返回顶部

收藏

oracle Select bulk collect into

更多
SQL>
SQL> CREATE TABLE MyTable (
  2    num_col    NUMBER,
  3    char_col   VARCHAR2(60)
  4    );

Table created.

SQL>
SQL> DECLARE
  2    TYPE t_Numbers IS VARRAY(10) OF MyTable.num_col%TYPE;
  3    v_Numbers t_Numbers;
  4  BEGIN
  5    SELECT num_col
  6      BULK COLLECT INTO v_Numbers
  7      FROM MyTable;
  8  END;
  9  /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL>
SQL> drop table MyTable;

Table dropped.

SQL>
SQL>

标签:oracle,select,sql

收藏

0人收藏

支持

0

反对

0

发表评论