1

I perform the following query:

declare 
  i number;
begin
  execute immediate 'select count(1) from someTable' returning into i;
  dbms_output.put_line(i);
end;

and get this Error: returning clause must be used with insert, update and delete!

sampathsris
  • 21,564
  • 12
  • 71
  • 98
  • possible duplicate of [Using bind variables with dynamic SELECT INTO clause in PL/SQL](http://stackoverflow.com/questions/7816402/using-bind-variables-with-dynamic-select-into-clause-in-pl-sql) – OldProgrammer Jun 02 '14 at 14:04

1 Answers1

1

Just a small syntax error (no RETURNING):

DECLARE
    i NUMBER;
BEGIN
    EXECUTE IMMEDIATE 'select count(1) from user_tables' INTO i;
    dbms_output.put_line(i);
END;
doberkofler
  • 9,511
  • 18
  • 74
  • 126