Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Help with EXPORT TABLE SQL
Tue, Jan 23 2007 12:31 PMPermanent Link

Pierre Roux
Is it possible to specify the date in filename when running EXPORT TABLE?  If so what syntax is correct?  
Text filename would be orders070122.txt.

Thanks
Tue, Jan 23 2007 1:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< Is it possible to specify the date in filename when running EXPORT TABLE?
If so what syntax is correct?  Text filename would be orders070122.txt. >>

Sure, but you have to do so when you create the SQL statement like this:

with DBISAMQuery do
  begin
  SQL.Text:='EXPORT TABLE orders TO
'+QuotedStr('orders'+StringReplace(DateToStr(Date()),'/','',[rfReplaceAll]));
  ExecSQL;
  end;

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jan 24 2007 8:52 AMPermanent Link

Pierre Roux
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Pierre,

<< Is it possible to specify the date in filename when running EXPORT TABLE?
If so what syntax is correct?  Text filename would be orders070122.txt. >>

Sure, but you have to do so when you create the SQL statement like this:

with DBISAMQuery do
  begin
  SQL.Text:='EXPORT TABLE orders TO
'+QuotedStr('orders'+StringReplace(DateToStr(Date()),'/','',[rfReplaceAll]));
  ExecSQL;
  end;

Hi Tim,

Thanks, however would like to do this using the SQL Query Tool with the Database Sytem Utility?  Does htat change anything.

Regards
Pierre

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jan 24 2007 11:26 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< Thanks, however would like to do this using the SQL Query Tool with the
Database Sytem Utility?  Does htat change anything. >>

Just simply type in the desired file name in the EXPORT TABLE statement in
that case:

EXPORT TABLE orders TO 'c:\export\orders01242007.txt'

--
Tim Young
Elevate Software
www.elevatesoft.com



Thu, Jan 25 2007 10:13 AMPermanent Link

Pierre Roux
Hi Tim,

Did not want to have to edit the SQL each time but rather pull the system date and insertit as a string?  So EXPORT TABLE orers TO 'c:\export\orders'+CURRENT_DATE+'.txt'  however that
syntax does not appear to be working.

Thanks for your assistance.
Pierre

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Pierre,

<< Thanks, however would like to do this using the SQL Query Tool with the
Database Sytem Utility?  Does htat change anything. >>

Just simply type in the desired file name in the EXPORT TABLE statement in
that case:

EXPORT TABLE orders TO 'c:\export\orders01242007.txt'

--
Tim Young
Elevate Software
www.elevatesoft.com



Thu, Jan 25 2007 12:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< Did not want to have to edit the SQL each time but rather pull the system
date and insertit as a string?  So EXPORT TABLE orers TO
'c:\export\orders'+CURRENT_DATE+'.txt'  however that syntax does not appear
to be working. >>

Unfortunately the EXPORT TABLE statement requires a constant for the
destination file name.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image