Database to excel [message #82464] |
Thu, 29 May 2003 05:05 |
Raj
Messages: 411 Registered: November 1998
|
Senior Member |
|
|
I have a table customer master where in i have customername,customeraddress,customer phone and other columns.I want to retrieve this records in excel from database in alphabetical order.How should i go about it?
Please help as it is very urgent
|
|
|
Re: Database to excel [message #82468 is a reply to message #82464] |
Thu, 29 May 2003 06:08 |
Ajith
Messages: 13 Registered: May 2003
|
Junior Member |
|
|
Hi raj,
here is the code. you have to use Text_IO package. you can write this code in any trigger event you want. i had written this in the when-button-pressed event.
----------------
DECLARE
my_file TEXT_IO.file_type; -- Declare the variable as a file type.
cursor c1 is select country_id,country from country_cat;
v_countryid varchar2(30);
v_country varchar2(30);
BEGIN
my_file :=TEXT_IO.Fopen('C:abcd.xls','w'); -- Open the File to write.
For get in c1 loop
v_countryid:=get.country;
v_country:=get.country_id;
TEXT_IO.put_line(my_file,v_countryid||'------'||v_country); --Write the fetched values into xls file
End loop;
TEXT_IO.Fclose(my_file); -- Close the opened file
END;
---------------------
Hope it works. pls let me know if any problem occur.
|
|
|
|
|
Re: Database to excel [message #82529 is a reply to message #82464] |
Thu, 05 June 2003 00:53 |
shadow
Messages: 15 Registered: April 2003
|
Junior Member |
|
|
Hi raj I sent a answer it contains html code when I previewed it I saw wrong things if you want you can contact with me and I will send codes
|
|
|