Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Creating Memory Tables
Wed, May 30 2007 12:46 PMPermanent Link

Allan Brocklehurst
Hello;
I saw code somewhere here where one can create a memory table from an
existing physical table structure without  creating a SQL statement like
the following  below . Can some one point me in the right direction.
Thanks in advance
Allan

   QryBuildCallsTable.SQL.Add('    DROP TABLE IF  EXISTS
memory\CallsMemory"  ; ');
    QryBuildCallsTable.SQL.Add('    CREATE TABLE IF NOT EXISTS
"memory\CallsMemory"   ');
    QryBuildCallsTable.SQL.Add('   (   ');
    QryBuildCallsTable.SQL.Add('      "OID" GUID DEFAULT CURRENT_GUID,
  ');
    QryBuildCallsTable.SQL.Add('      "Emp_No" VARCHAR(10) NOT NULL
DEFAULT ' + QuotedStr('0') + ',   ');
    QryBuildCallsTable.SQL.Add('      "Cust_No" VARCHAR(10) NOT NULL
DEFAULT ' + QuotedStr('0') + ',   ');
    QryBuildCallsTable.SQL.Add('      "Call_No" VARCHAR(10) NOT NULL
DEFAULT ' + QuotedStr('0') + ',   ');

........




Attachments: brock.vcf
Wed, May 30 2007 12:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Allan,

<< I saw code somewhere here where one can create a memory table from an
existing physical table structure without  creating a SQL statement like the
following  below . Can some one point me in the right direction. >>

Check out the code here:

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

Just use the code at the beginning for creating the table:

     with SourceTable do
        begin
        FieldDefs.Update;
        IndexDefs.Update;
        end;
     with DestTable do
        begin
         FieldDefs.Assign(SourceTable.FieldDefs);
         IndexDefs.Assign(SourceTable.IndexDefs);
         CreateTable(SourceTable.LocaleID,
                       SourceTable.UserMajorVersion,
                       SourceTable.UserMinorVersion,
                       SourceTable.Encrypted,
                       SourceTable.Password,
                       SourceTable.Description,
                       SourceTable.IndexPageSize,
                       SourceTable.BlobBlockSize,
                       SourceTable.LastAutoIncValue);
        end;

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, May 30 2007 1:03 PMPermanent Link

Allan Brocklehurst
Tim Young [Elevate Software] wrote:
> Allan,
>
> << I saw code somewhere here where one can create a memory table from an
> existing physical table structure without  creating a SQL statement like the
> following  below . Can some one point me in the right direction. >>
>
> Check out the code here:
>
> http://www.elevatesoft.com/dbisam_faqt_20.htm
>
> Just use the code at the beginning for creating the table:
>
>       with SourceTable do
>          begin
>          FieldDefs.Update;
>          IndexDefs.Update;
>          end;
>       with DestTable do
>          begin
>           FieldDefs.Assign(SourceTable.FieldDefs);
>           IndexDefs.Assign(SourceTable.IndexDefs);
>           CreateTable(SourceTable.LocaleID,
>                         SourceTable.UserMajorVersion,
>                         SourceTable.UserMinorVersion,
>                         SourceTable.Encrypted,
>                         SourceTable.Password,
>                         SourceTable.Description,
>                         SourceTable.IndexPageSize,
>                         SourceTable.BlobBlockSize,
>                         SourceTable.LastAutoIncValue);
>          end;
>
WOW your FAST!!!  Thanks
 I just had searched the web based form and also go this from a posting
of yours dated 9/28/2005

Allan
-----------------------------------
The easiest way is this:

with MyDiskTable do
  begin
  DatabaseName:='c:\test';
  TableName:='mytable';
  CopyTable('Memory','mytable');
  end;

Then, just use another TDBISAMTable component to open it up:

with MyMemoryTable do
  begin
  DatabaseName:='Memory';
  TableName:='mytable';
  Open;
  end;
----------------------------------



Attachments: brock.vcf
Image