I have made some adjustments to the script, to fit it to my perticular needs. Below you will find some of the adjustments made to the package. 1. When using the procedure generate_view_sql, I received some errors on more complex views when trying to create them on the target database. Therefor I made the underneath mentioned adjustments. Maybe they are useful for other users of the package gensql too: ********* PROCEDURE create_view AS /* File name to save script */ wvwsqlfile VARCHAR2 (24) := '007_create_view.sql'; wvwsqlftype UTL_FILE.FILE_TYPE; /* Views */ CURSOR cvw IS SELECT obj$.name naam, view$.text tekst, user$.name owner, obj$.obj# o FROM obj$, view$, user$ WHERE obj$.obj# = view$.obj# AND obj$.owner# = user$.user# AND user$.name <> 'SYS' AND user$.name <> 'SYSTEM' AND user$.name <> 'DBSNMP' AND user$.name <> 'TOAD'; /* View Columns */ CURSOR ccol ( o IN NUMBER) IS SELECT DECODE(col#,1,'(',',')||DECODE(name,null,null,name) name FROM col$ WHERE obj# = o ORDER BY col#; BEGIN dbms_output.enable (999999); wvwsqlftype := UTL_FILE.FOPEN(utldir, wvwsqlfile, 'w'); UTL_FILE.PUT_LINE(wvwsqlftype, 'spool 007_create_view.log'); UTL_FILE.PUT_LINE(wvwsqlftype, 'set echo on'); FOR rvw IN cvw LOOP UTL_FILE.PUT_LINE(wvwsqlftype, 'create view ' || rvw.owner || '.' || rvw.naam); FOR rcol IN ccol (rvw.o) LOOP UTL_FILE.PUT_LINE(wvwsqlftype, rcol.name); END LOOP; UTL_FILE.PUT_LINE(wvwsqlftype, ') as ' || rvw.tekst); UTL_FILE.PUT_LINE(wvwsqlftype, '/'); END LOOP; UTL_FILE.PUT_LINE(wvwsqlftype, 'set echo off'); UTL_FILE.PUT_LINE(wvwsqlftype, 'spool off'); UTL_FILE.FCLOSE(wvwsqlftype); END; ******************** (I left out the errorhandling and help part.) This makes sure that when creating a view the script looks like: create view example(column1, column2....) as select ......... instead of create view example as select ........... 2. ********************** When you set the init.ora parameter utl_file_dir = * it doesn't matter how you set the parameter utldir in the package. (as long as you have sufficient privileges to the directory). 3. ********************** I added a line for the datatype ROWID in the column part of tables /* Columns */ CURSOR ccols (o in varchar2, t in varchar2) IS SELECT DECODE(column_id,1,'(',',') ||RPAD(column_name,40) ||RPAD(data_type,10) ||RPAD( DECODE(data_type,'DATE' ,' ' ,'LONG' ,' ' ,'LONG RAW',' ' ,'RAW' ,DECODE(data_length,null,null ,'('||data_length||')') ,'CHAR' ,DECODE(data_length,null,null ,'('||data_length||')') ---> ,'ROWID' ,DECODE(data_length,null,null) ,'VARCHAR' ,DECODE(data_length,null,null ,'('||data_length||')') ,'VARCHAR2',DECODE(data_length,null,null ,'('||data_length||')') ,'NUMBER' ,DECODE(data_precision,null,' ' ,'('||data_precision|| DECODE(data_scale,null,null,','||data_scale)||')'),'unknown'),8,' ') cstr FROM all_tab_columns WHERE table_name = UPPER(t) AND owner = UPPER(o) ORDER BY column_id;