Newsgroup: it.comp.software.database
Titolo: Procedure ORACLE che non funiona

Salve a tutti!!
ho questa procedura Oracle che dovrebbe creare un file TXT... ma non lo
crea... e la compilazione di tale procedura non mi da errore... dove
sbaglio?
CREATE OR REPLACE procedure CDD is
--
-- Aggiornamento presenze/assenze GAPP - Tracciato CDD -
-- Tracciato standard di alimentazione giustificativi di presenza assenza
dei dipendenti.
--
-- The Knowledge Team S.p.A.
-- Denis Carraro - 12 Giugno 2003
--
cursor c_cdd is
select a.CAPUSERNUMBER, a.LASTNAME, a.firstname,
to_char(c.STARTDATE,'dd/mm/yy') as START_DATE,
to_char(c.ENDDATE,'dd/mm/yy') as END_DATE, to_char(c.STARTDATE,'HH24:MI:SS')
as STARTDATETIME,
to_char(c.ENDDATE,'HH24:MI:SS') as ENDDATETIME, b.AuthorizationNumber,
e.LocationTypeName
from capuser a, trip b, tripsegment c, location d, locationType e
where a.capuserid=b.CAPUSERID and
b.TRIPID = c.TRIPID and
c.LocationID = d.LocationID and
d.LocationTypeID = e.LocationTypeID and
b.authorizationnumber is not null and
c.TRIPSEGMENTID not in (select indice from TKTAssenze)
ORDER BY a.CAPUSERNUMBER;
fil utl_file.file_type;
file_dir varchar2(4096) := 'd:\cdd';
log_file varchar2(128);
begin
-- log_file := 'ASSENZE.TXT';
dbms_output.put_line('Ciao');
log_file := 'AS' || to_char(sysdate, 'YYMMDD') || '.TXT';
dbms_output.put_line(log_file);
fil := utl_file.fopen(file_dir,log_file,'w');
if not utl_file.is_open(fil) then
dbms_output.put_line('Impossibile aprire ' || file_dir ||'\'|| log_file );
return;
end if;
for a in c_cdd
loop
utl_file.put_line (fil, lpad(substr(nvl(a.CAPUSERNUMBER,' '),1,7),7,'0') ||
',' ||
rpad(nvl(a.LastName,' '),25) || ',' || rpad(nvl(a.FirstName,' '),25) || ','
||
rpad(nvl(a.START_DATE,' '),8) || ',' || rpad(nvl(a.END_DATE,' '),8) || ','
||
rpad(nvl(a.STARTDATETIME,' '),8) || ',' || rpad(nvl(a.ENDDATETIME,' '),8) ||
',' ||
rpad(nvl(a.AuthorizationNumber,' '),25) || ',' ||
rpad(nvl(a.LocationTypeName,' '),25) || ',' ||
',' );
end loop;
if utl_file.is_open(fil) then
utl_file.fflush(fil);
utl_file.fclose(fil);
end if;
insert into TKTASSENZE (NOMEFILE, INDICE)
select distinct log_file , c.TRIPSEGMENTID
from capuser a, trip b, tripsegment c
where a.capuserid=b.CAPUSERID and
b.TRIPID = c.TRIPID and
b.authorizationnumber is not null and
c.TRIPSEGMENTID not in (select indice from TKTAssenze);
commit;
exception
when utl_file.INVALID_PATH then
sys.dbms_output.put_line('utl_file: invalid path ' || file_dir ||'\'||
log_file);
when utl_file.INVALID_MODE then
sys.dbms_output.put_line('utl_file: invalid mode ' || file_dir ||'\'||
log_file);
when utl_file.INVALID_OPERATION then
sys.dbms_output.put_line('utl_file: invalid operation ' || file_dir ||'\'||
log_file );
when utl_file.INVALID_FILEHANDLE then
sys.dbms_output.put_line('utl_file: invalid filehandle ' || file_dir ||'\'||
log_file );
when utl_file.READ_ERROR then
sys.dbms_output.put_line('utl_file: read error ' || file_dir ||'\'||
log_file );
when utl_file.WRITE_ERROR then
sys.dbms_output.put_line('utl_file: write error ' || file_dir ||'\'||
log_file );
when utl_file.INTERNAL_ERROR then
sys.dbms_output.put_line('utl_file: internal error ' || file_dir ||'\'||
log_file );
when others then
sys.dbms_output.put_line('utl_file: other error ' || file_dir ||'\'||
log_file );
end CDD;

Dimenticavo.. l'errore si trova qui :(


 Salve a tutti!!
paramtero utl_file_dir = ?????
nella init$SID.ora !
felice_pago
--------------------------------
Inviato via 
http://usenet.libero.it