RE: util file help required

RE: util file help required

 

  


put quotes around the filepath , filename

output := utl_file.fopen('/db/oracle/test','view.txt', 'w' );

-----Original Message-----
From: hrishy
Sent: Tuesday, April 30, 2002 11:24 AM
To: LazyDBA.com Discussion
Subject: util file help required


Hi Folks
[Email Address Removed] declare
2 type my_curs_type is REF CURSOR;
3 curs my_curs_type;
4 --str varchar2(1000);
5 --t_name varchar2(50);
6 c_name varchar2(50);
7 --tab_name varchar2(2000);
8 cursor cur_tab_name is select distinct table_name
as tab_name from
9 user_tables where table_name like '%917';
10 query_txt varchar2(4000);
11 output utl_file.file_type;
12 begin
13 output := utl_file.fopen( /db/oracle/test,
view.txt, 'w' );
14 for rr in cur_tab_name loop
15 OPEN curs FOR select column_name from
user_tab_columns
16 where table_name=rr.tab_name and column_name
17 not in ('T$REFCNTD','T$REFCNTU');
18 query_txt := 'create or replace view
'||rr.tab_name||'_vw as select ';
19 loop
20 fetch curs into c_name;
21 EXIT WHEN curs%NOTFOUND;
22 query_txt := query_txt||c_name||',';
23 end loop;
24 close curs;
25 query_txt := rtrim(query_txt,',');
26 query_txt := query_txt||' from '||rr.tab_name;
27 dbms_output.put_line(query_txt);
28 util_file.put(output,query_txt);
29 util_file.newline(output);
30 end loop;
31 utl_file.fclose( output );
32 end;
33 /
output := utl_file.fopen( /db/oracle/test,
view.txt, 'w' );
*
ERROR at line 13:
ORA-06550: line 13, column 30:
PLS-00103: Encountered the symbol "/" when expecting
one of the following:
( ) - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind
variable> avg
count current exists max min prior sql stddev sum
variance
cast <a string literal with character set
specification>
<a number> <a single-quoted SQL string>


am i using the proceedure rightly .as i getting a
message

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--------
Oracle documentation is here:
http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] the list archive: http://www.LAZYDBA.com/odbareadmail.pl
Tell yer mates about http://www.farAwayJobs.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page