Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 16 of 16 total
Thread Tricky SQL help
Thu, Jun 14 2007 2:19 PMPermanent Link

"Robert"
Roy, see my comments below. Is I right?

Robert

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:92A77DCC-5479-4C63-8413-1585FD1C1B80@news.elevatesoft.com...
>
> procedure ZapInMemoryTable(WhichTable: TDBISAMTable);
> begin
> try
> if Assigned(WhichTable) and WhichTable.Exists then begin
> WhichTable.DisableControls;  // not needed
> WhichTable.Close;
> WhichTable.Exclusive := True; // not needed
> if not (WhichTable.Bof and WhichTable.Eof) then WhichTable.EmptyTable; //
> not needed
> WhichTable.DeleteTable;
> FreeAndNil(WhichTable);
> end;
> except
> end;
> end;

Thu, Jun 14 2007 2:24 PMPermanent Link

"Robert"

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:92A77DCC-5479-4C63-8413-1585FD1C1B80@news.elevatesoft.com...
>
> You are doing it correctly to remove the memory table, however, I'd ditch
> the .Prepare.

In fact, some programmers *always* use an explicit prepare, which is a
mistake. Explicit prepare should ONLY be used on queries that are expected
to be executed more than once. Using prepare on other circumstances
needlessly leaves datasets assigned to the query.

Robert.

Thu, Jun 14 2007 2:33 PMPermanent Link

Bryan
Roy,
Thanks for the advise and sample code...
Since the numeric tables do get created, can I control which folder they go into?

Thanks again,
Bryan

Roy Lambert <roy.lambert@skynet.co.uk> wrote:

Bryan


Just to expand on what Robert said.

The numeric named tables are DBISAM's temporary tables created when you run a query resulting in a canned dataset. These are cleaned up whenever the query is closed. If you find them on your disk after closing an app (or
the IDE) its because the system didn't shut down correctly.

Thu, Jun 14 2007 2:34 PMPermanent Link

Bryan
Thanks for your suggestions Robert.
DBISAM support is outstanding!!!!

Bryan

"Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote:


"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:92A77DCC-5479-4C63-8413-1585FD1C1B80@news.elevatesoft.com...
>
> You are doing it correctly to remove the memory table, however, I'd ditch
> the .Prepare.

In fact, some programmers *always* use an explicit prepare, which is a
mistake. Explicit prepare should ONLY be used on queries that are expected
to be executed more than once. Using prepare on other circumstances
needlessly leaves datasets assigned to the query.

Robert.

Thu, Jun 14 2007 4:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Bryan,

<< Since the numeric tables do get created, can I control which folder they
go into? >>

The TDBISAMSession.PrivateDirectory controls this:

http://www.elevatesoft.com/dbisam4d7_starting_sessions.htm

(see at the bottom).

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jun 15 2007 1:32 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Robert


Pretty much correct as far as my understanding goes.

Roy Lambert
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image