Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Extract data to TXT format
Wed, Mar 7 2007 6:19 PMPermanent Link

Francis de Traves
Hy!

I am new with dbisam and i have no skills in the programing schem. I need to export/extract a dbisam database to txt format. Is there any
aplication that can do that?? I meen an app who could export the whole db and not only a single database (that is multi txt files at once).
Any reply would be most apriciated!
Thanks!
Wed, Mar 7 2007 6:22 PMPermanent Link

Francis de Traves
Mistake:
I meen table and not database....

Hy!

I am new with dbisam and i have no skills in the programing schem. I need to export/extract a dbisam database to txt format. Is there any
aplication that can do that?? I meen an app who could export the whole db and not only a single "<b>table</b>" (that is multi txt files at once).
Any reply would be most apriciated!
Thanks!
Wed, Mar 7 2007 7:18 PMPermanent Link

"Donat Hebert \(Worldsoft\)"
Francis,

DBSys has an Export Table (Open the table, then under Action, Export)
Allows column select and choice of delimiters.  HTH

Donat.


"Francis de Traves" <traves@esdrt.es> wrote in message
news:998A362A-B120-4AC3-8DD6-268DDF98C35C@news.elevatesoft.com...
> Mistake:
> I meen table and not database....
>
> Hy!
>
> I am new with dbisam and i have no skills in the programing schem. I need
> to export/extract a dbisam database to txt format. Is there any
> aplication that can do that?? I meen an app who could export the whole db
> and not only a single "<b>table</b>" (that is multi txt files at once).
> Any reply would be most apriciated!
> Thanks!
>

Thu, Mar 8 2007 6:06 AMPermanent Link

Francis de Traves
"Donat Hebert \(Worldsoft\)" <donat.hebert@worldsoft.ca> wrote:

Thanks Donat for your reply.

But i am looking for something that could extract the entire database and not only one table of the database. Is there such thing?
Thanks!


Thu, Mar 8 2007 7:02 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Francis


There is no such tool available. But it will be easy to write your own.

Use FindFirst/FindNext to get a list of .dat files in the directory

Loop round setting a TDBISAMTable component's TableName and use the .ExportTable method

If you want everything in one file use temporary file names based on the tablename +.txt then get a list of those, loop round, and build your own file.

It depends on what you want to do with it after you've got it. You could also use the reverse engineer option to produce table structure and sql data.




Roy Lambert
Tue, Mar 20 2007 6:37 PMPermanent Link

Francis de Traves
Thanks Roy for your answer.
Since there is no such tool, I must use one of my own. But i am not very experienced coding with dbisam.
What app should i use?
Delphi?
Thanks.
Tue, Mar 20 2007 10:06 PMPermanent Link

Sanford Aranoff


Francis de Traves wrote:

> Thanks Roy for your answer.
> Since there is no such tool, I must use one of my own. But i am not very experienced coding with dbisam.
> What app should i use?
> Delphi?
> Thanks.

function TDBISAMTable.save_csv( const file_name: string; const let: char): boolean;
var
TableList : TMyStringList;
i,j,k,kk  : integer;
line1,
line_   : string;
begin
TableList:= TMyStringList.Create(false);
with TableList do
try
 set_SQLWait(false);
 DisableControls;
 Result:= get_first and (FieldCount > 0);
 if not Result then
  exit;
 j:= pred(FieldCount);
 k:= 0;
 for i:= 0 to j do
 begin
  with Fields[i] do
  begin
   if not visible then
    continue;
   line1:= DisplayLabel;
   if line1 = '' then
    line1:= FieldName
  end;
  if k = 0 then
   line_:= line1
  else
   line_:= line_ + let + line1;
  inc(k)
 end;
 Add(';' + line_);
 repeat
  k:= 0;
  for i:= 0 to j do
  begin
   with Fields[i] do
   begin
    if not visible then
     continue;
    if DataType = ftCurrency then
     line1:=  FloatToStrF(AsCurrency,ffCurrency,15,2)
    else
     line1:= AsString
   end;
           if let = comma then
           repeat
              kk:= pos(comma,line1);
              if kk > 0 then
                 System.Delete(line1,kk,1)
           until kk = 0;
   if k = 0 then
    line_:= line1
   else
    line_:= line_ + let + line1;
   inc(k)
  end;
  Add(line_)
 until not get_next;
 get_first;
 Result:= MySaveToFile(file_name);
 if Result then
  add_action('File saved to ' + file_name)
finally
 EnableControls;
 hourglass(true);
 my_free
end
end;


Image