如何分配作为查询PL / SQL ORACLE的结果的变量

时间:2016-07-27 14:48:39

标签: oracle variables plsql

enter image description here

早上好,我是PL / SQL的新手,我不知道为什么会导致错误。

SET SERVEROUTPUT ON

DECLARE      

  designation VARCHAR2(3000);

BEGIN           
       SELECT LISTAGG(x.ACCOUNT, ',') WITHIN GROUP (ORDER BY NULL) AS ACCOUNT
     INTO designation           
     FROM acctx x
     where x.OBJECT_ID = 1;



     DBMS_OUTPUT.PUT_LINE(designation); 
END;
/

错误是

  

ORA-0092;缺少或无效的选项

此查询的结果

SELECT LISTAGG(x.ACCOUNT, ',') WITHIN GROUP (ORDER BY NULL) AS ACCOUNT

     FROM acctx x
     where x.OBJECT_ID = 1;

6012,6061,6082,6068,6018

0 个答案:

没有答案