1
create or replace function gen_file() returns void as $$
6
f := utl_file.fopen('/tmp','regress_orafce','w');
7
for r in select m from generate_series(1,20) m(m) loop
8
perform utl_file.put_line(f, r.m::numeric);
10
f := utl_file.fclose(f);
16
create or replace function read_file() returns void as $$
20
f := utl_file.fopen('/tmp','regress_orafce','r');
22
raise notice '>>%<<', utl_file.get_line(f);
25
-- when no_data_found then, 8.1 plpgsql doesn't know no_data_found
27
raise notice 'finish % ', sqlerrm;
29
f := utl_file.fclose(f);