Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Memory table with unique name |
Thu, Jun 21 2007 10:43 AM | Permanent Link |
Praveen A B | Hi,
I'm migrating from DBISAM 3.x to ElevateDB today. In DBISAM I use in-memory tables with same tablename and suffix i.e. TAB_0, TAB_1, TAB_2 etc. I find the unique name for the table as such repeat ATable.TableName := TableName+'_'+IntToStr(Suffix); Inc(Suffix); until not ATable.Exists; Any equivalent code in ElevateDB ? Thanks Praveen |
Thu, Jun 21 2007 12:36 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Praveen
Its probably better to use the catalog eg Num:=1; with SetupQuery do begin Close; SQL.Clear; SQL.Text := 'SELECT * FROM Information.Tables WHERE Name=' + QuotedStr('TAB_'); Open; if (RecordCount > 0) then begin Last; Num:=1+StrToInt(Copy(FieldByName('Name').AsString,Length(FieldByName('Name').AsString),1); end; Num will give you the suffix to use in your table create routine Roy Lambert |
Fri, Jun 22 2007 6:49 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Praveen,
<< I'm migrating from DBISAM 3.x to ElevateDB today. In DBISAM I use in-memory tables with same tablename and suffix i.e. TAB_0, TAB_1, TAB_2 etc. I find the unique name for the table as such >> The easiest thing to use in ElevateDB is CREATE TEMPORARY TABLE. That way you don't have to worry about the actual table name, and you can just name it whatever you want. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Jun 22 2007 7:28 AM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< The easiest thing to use in ElevateDB is CREATE TEMPORARY TABLE. >> This syntax seems to be missing from the documentation of the CREATE TABLE statement. Btw, is it possible to change a temporary table definition using the ALTER TABLE statement ? I tried the following: create temporary table Temp (col1 integer) alter table Temp add constraint pk_Temp primary key (col1) Error: ElevateDB Error #401 The table Temp does not exist Ole Willy Tuv |
Fri, Jun 22 2007 8:04 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< This syntax seems to be missing from the documentation of the CREATE TABLE statement. >> It sure is. I'll make sure this is fixed. << Btw, is it possible to change a temporary table definition using the ALTER TABLE statement ? >> No. You can only create/drop indexes on a temporary table - you can't alter them or add/drop triggers on them. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |