facing UTL-FILE error...
639991May 19 2008 — edited Aug 11 2008Hello this is my first post, Iam working under training where my job description involves pl/sql, where I was asked to retreive all customers in a block I choosed CURSOR, where they must be 'active contracts' and must be within 01/01/2008 till 31/01/2008 in addition to that I was provided with the fields :
CUSTCOD
CO_ID
CUSTOMER_ID
CONTRACT_STATUS
CONTRACT_DATE
here is my code...the problem is i keep getting these errors....
Please note that Iam working on TOAD 7.4.0.3
The following error has occurred:
ORA-06550: line 16, column 3:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 16, column 3:
PL/SQL: Statement ignored
Declare
output utl_file.file_type;
cursor activecontract IS
select cu.CUSTCODE, ca.CO_ID, ca.CUSTOMER_ID, ch.CH_STATUS, ch.CH_VALIDFROM
from customer_all cu, contract_history ch, contract_all ca
where ch.CH_STATUS = 'a'
and ch.CH_VALIDFROM >= to_date ('01/01/2008','dd/mm/yyyy')
and ch.CH_VALIDFROM < to_date ('01/02/2008','dd/mm/yyyy')
and ch.CO_ID = ca.CO_ID
and cu.CUSTOMER_ID = ca.CUSTOMER_ID;
BEGIN
output := utl_file.fopen('c:\temp\', 'activecontract.txt', 'w');
open activecontract;
For trial In activecontract
Loop
utl_file.put_line(trial.CUSTCODE,trial.CH_VALIDFROM);
--Fetch activecontract into custcod, co_id, customer_id, contract_status, contract_date
--Exit when activecontract%notfound
--DBMS_OUTPUT.PUT_LINE('customer code:'|| trial.custcode || 'Date:' || trial.contract_date);
End Loop;
utl_file.fclose(output);
End;
Much appreciated if someone could plz help me to run this block.....thanx
Tomy