select a column and create a text file
Posted: Thu 24 Jan 2008 16:24
Hi,
I am new to Delphi /Odac so forgive me.
I have a column in an oracle table that I would like sorted and dumped to a text file. Each row being a new line. Approximately 1000 rows in the table.
What is the best method for doing this?
I would very much appreciate explicit code in your reply please.
I would assume:
define a query in OraQuery component with order by included
assign and rewrite (text) file giving filevariable fv.
fetch first row
while not eof do
begin
Writeln (fv, "fetched row")
fetch
end
close (fv);
To be honest it is the fetch that I am unfamilar with. How is this done?
Also I was wondering of the select and save at text file could be done in two statements.
I am new to Delphi /Odac so forgive me.
I have a column in an oracle table that I would like sorted and dumped to a text file. Each row being a new line. Approximately 1000 rows in the table.
What is the best method for doing this?
I would very much appreciate explicit code in your reply please.
I would assume:
define a query in OraQuery component with order by included
assign and rewrite (text) file giving filevariable fv.
fetch first row
while not eof do
begin
Writeln (fv, "fetched row")
fetch
end
close (fv);
To be honest it is the fetch that I am unfamilar with. How is this done?
Also I was wondering of the select and save at text file could be done in two statements.