tags:

views:

337

answers:

1

I am trying to run the following code within SQLPlus:

exec lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',
                                      column_name => 'OLS_COLUMN',
                                      default_options => 'READ_CONTROL,INSERT_CONTROL,UPDATE_CONTROL,DELETE_CONTROL,LABEL_DEFAULT,LABEL_UPDATE,CHECK_CONTROL,');

However, I'm getting the following error:

BEGIN lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',; END;

                                                                        *
ERROR at line 1:
ORA-06550: line 1, column 78:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date <a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively

It seems to me to be something I'm doing wrong with the syntax. I'm just not sure what it is. Any help would be appreciated. Thanks :)

+3  A: 

The EXEC statement takes a line of code and wraps it in a BEGIN/END block. In this case you want to split your call over several lines of code, so you'll probably find it easier to add the BEGIN/END yourself:

BEGIN
  lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',
                                  column_name => 'OLS_COLUMN',
                                  default_options =>
       'READ_CONTROL,INSERT_CONTROL,'
    || 'UPDATE_CONTROL,DELETE_CONTROL,'
    || 'LABEL_DEFAULT,LABEL_UPDATE,CHECK_CONTROL,');
END;
/
Jeffrey Kemp