Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
Memory tables creation |
Tue, May 8 2007 5:33 AM | Permanent Link |
Abdulaziz Jasser | Hi all,
We use DBISAM 3.30 and currently working on the migration of the source code of one big project to ELDB for evaluation purposes. With 3.30 we use this procedure to create memory tables: procedure CreateMemoryTable(var oTable : TEDBTable; sTableName : String = ''; bCreateTable : Boolean = True; bIncludeIndexs : Boolean = False); begin if oTable = Nil then oTable := TEDBTable.Create(Application); if sTableName <> '' then begin oTable.TableName := sTableName; oTable.DatabaseName := dmAccount.EDBDatabase1.DatabaseName; oTable.SessionName := dmAccount.EDBSession1.SessionName; oTable.FieldDefs.Update; if bIncludeIndexs then oTable.IndexDefs.Update; end; oTable.DatabaseName := 'Memory'; oTable.SessionName := dmAccount.EDBSession1.SessionName; oTable.TableName := GetRandomName;//Return random names. if bCreateTable then oTable.CreateTable; end; This function takes one mandatory parameter which is the first parameter and the rest are optional. Any suggestions on how to make the minimum changes to this procedure to able to use it with ELDB?. |
Tue, May 8 2007 7:45 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Abdulaziz,
<< Any suggestions on how to make the minimum changes to this procedure to able to use it with ELDB?. >> You have to use SQL to create tables in ElevateDB: http://www.elevatesoft.com/edb1sql_create_table.htm To create an in-memory database to use with the in-memory tables, you also have to use the CREATE DATABASE statement first with the IN MEMORY clause: http://www.elevatesoft.com/edb1sql_create_database.htm Then you can issue the CREATE TABLE statements using that database as the current database like this: with MyEDBDatabase do begin SessionName:='MySession'; DatabaseName:='MyDatabase'; Database:='MyMemoryDatabase'; <<<< same name as CREATE DATABASE above Execute('CREATE TABLE MyTable..... etc.'); end; -- Tim Young Elevate Software www.elevatesoft.com |
Wed, May 9 2007 7:06 AM | Permanent Link |
Abdulaziz Jasser | Thanks Tim for the post. But really we are facing serious problems with new methods of implementing in-memory tables. They way it's done here
in ELDB is very different from they way it was in DBISAM 3 & 4 and the help files are not complete. Maybe you could try to post a complete example about this. Mean while I will try to implement your code as soon as return back to my office. Regards, Abdulaziz Jasser "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote: Abdulaziz, << Any suggestions on how to make the minimum changes to this procedure to able to use it with ELDB?. >> You have to use SQL to create tables in ElevateDB: http://www.elevatesoft.com/edb1sql_create_table.htm To create an in-memory database to use with the in-memory tables, you also have to use the CREATE DATABASE statement first with the IN MEMORY clause: http://www.elevatesoft.com/edb1sql_create_database.htm Then you can issue the CREATE TABLE statements using that database as the current database like this: with MyEDBDatabase do begin SessionName:='MySession'; DatabaseName:='MyDatabase'; Database:='MyMemoryDatabase'; <<<< same name as CREATE DATABASE above Execute('CREATE TABLE MyTable..... etc.'); end; -- Tim Young Elevate Software www.elevatesoft.com |
Wed, May 9 2007 5:35 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Abdulaziz,
<< Thanks Tim for the post. But really we are facing serious problems with new methods of implementing in-memory tables. They way it's done here in ELDB is very different from they way it was in DBISAM 3 & 4 and the help files are not complete. Maybe you could try to post a complete example about this. Mean while I will try to implement your code as soon as return back to my office. >> The complete example is the CREATE DATABASE..IN MEMORY statement. That's all there is to it, and then you have the exact same thing that you had with DBISAM 4, except with perhaps a different name for the database than "Memory". I think you're getting the wrong idea about what is involved, or perhaps you're thrown off by the fact that you must use SQL to create tables now ? -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Monday, May 6, 2024 at 12:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |