18 Dec 2007

Oracle XE and UTL_FILE: Error starting at line 1 ...

If you just installed OracleXE, and while compiling some plsql code you get an error message that says:

Error starting at line 1 in command: DECLARE file_id UTL_FILE.FILE_TYPE

Than, the solution is quite easy, you just have to:

1) open sqlplus and connect to the dbms:

C:\> sqlplus

2) conenct as dba:

SQL> conn sys as SYSDBA

3) execute the script utlfile.sql located in your oracle admin directory:

SQL> @D:\oracle\app\oracle\product\10.2.0\server\RDBMS\ADMIN\utlfile.sql

4) ... and, remeber to grant execution to your normal user (or PUBLIC)

SQL> GRANT EXECUTE on SYS.UTL_FILE TO PUBLIC

.

No comments: