Hi,
I need results as follow
EMPLOYEE_ID
--------------------------
206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, ...
Unfortunately i'm getting following error which i cant fix my self.Please help me on this.
error :
ORA-06550: line 53, column 45:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( ) , * % & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
-----------------------------------------------------------------------------------------------------------------------------
My Code :
DECLARE
varSql VARCHAR2(4000);
BEGIN
varSql:= 'SELECT LISTAGG(A.EMPLOYEE_ID, ', ') WITHIN GROUP (ORDER BY S.EMPLOYEE_ID)';
varSQL := varSQL||' FROM HR.EMPLOYEES A';
EXECUTE IMMEDIATE varSql;
DBMS_OUTPUT.PUT_LINE(varSql);
END;