Home » SQL & PL/SQL » SQL & PL/SQL » Output file and exit;
Output file and exit; [message #37992] Tue, 12 March 2002 21:38 Go to next message
Stephanie
Messages: 5
Registered: March 2002
Junior Member
Hi,

the query finds the record from the table "listzert", where efaell = sysdate +7.

The problem:
although a data record is to be produced an output file is to be created.
Otherwise the query can be terminated (> exit).

The code:

declare
cursor c_lz is
select * from listzert
where trunc(efaell) = trunc(sysdate+7);

begin
dbms_output.enable(100000);
for r_lz in c_lz loop
dbms_output.put_line(r_lz.deponent);
dbms_output.new_line;
end loop;
end;
/
commit;

Thanks, Stephanie
Re: Output file and exit; [message #37994 is a reply to message #37992] Wed, 13 March 2002 00:38 Go to previous messageGo to next message
Pratibha
Messages: 29
Registered: November 2001
Junior Member
Hi

Your problem is not clear, what is the problem in the code? is it not displaying properly? or u want to write the output to a file?
if u want to write the displayed output to a file, then
u have to make use of a utility-utl_file.

Pls. explain your problem properly:

Bye
Upps! >>> exit [message #37998 is a reply to message #37992] Wed, 13 March 2002 00:57 Go to previous message
Stephanie
Messages: 5
Registered: March 2002
Junior Member
Hi,
when the condition is wrong:
How can I exit the Query and NO Output File will be created?

When the condition is okay -> Output in a file

Thanks,
Stephanie
Previous Topic: code does not get executed, why??????
Next Topic: How to select n-1 columns in a table with n columns ?
Goto Forum:
  


Current Time: Tue Apr 16 08:28:43 CDT 2024