SQL Language (MOSC)

MOSC Banner

execute immediate not working in for loop

edited Dec 4, 2014 10:03AM in SQL Language (MOSC) 5 commentsAnswered

SQL> BEGIN

  2   FOR cur_user IN (SELECT username FROM dba_users WHERE temporary_tablespace = 'TEMP_C')

  3   loop

  4  EXECUTE IMMEDIATE 'ALTER USER ' || cur_user.username || ' TEMPORARY TABLESPACE temp';

  5  END LOOP;

  6  END;

  7  /

BEGIN

*

ERROR at line 1:

ORA-00922: missing or invalid option

ORA-06512: at line 4

What am I doing wrong?

Regards

Ed

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center