Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 7 of 7 total |
SELECT @@IDENTITY |
Wed, Aug 18 2010 7:09 AM | Permanent Link |
Sergey A. Kolotov | How I can use SELECT @@IDENTITY in ElevateDB?
How I can get ID of last added record into table? |
Wed, Aug 18 2010 10:42 AM | Permanent Link |
Sergey A. Kolotov | How I can get ID after insert when ID parameter is not present in SQL statement?
EDBQuery1.SQL.Clear; EDBQuery1.SQL.Add('INSERT INTO Table1 (Text1)'); EDBQuery1.SQL.Add('VALUES(:Text1)'); EDBQuery1.ExecSQL; ShowMessage(EDBQuery1.ParamByName('ID').AsString); It is table creation statement: CREATE TABLE "Table1" ("ID" INTEGER GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1) PRIMARY KEY, "Text1" VARCHAR(25) COLLATE "UNI") |
Wed, Aug 18 2010 11:38 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sergey
Search for this subject DBISAM -> EDB: LASTAUTOINC in this newsgroup. I think the answer is there. Roy Lambert [Team Elevate] |
Fri, Aug 20 2010 11:19 AM | Permanent Link |
Sergey A. Kolotov | There is a error "ElevateDB Error #700 An error was found in the statement at line 1 and column 8 (ElevateDB Error #401 The function LASTAUTOINC does not exist in the schema Default)" at SQL statement "select LASTAUTOINC("Table1") from Table1".
|
Fri, Aug 20 2010 12:06 PM | Permanent Link |
Uli Becker | LastAutoInc does not exist in EDB.
|
Sat, Aug 21 2010 3:06 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sergey
MAX(columnname) Roy Lambert |
Mon, Aug 23 2010 7:32 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Sergey,
<< How I can get ID after insert when ID parameter is not present in SQL statement? >> What you want is this: EDBQuery1.SQL.Clear; EDBQuery1.SQL.Add('INSERT INTO Table1 (ID, Text1)'); EDBQuery1.SQL.Add('VALUES(:ID, :Text1)'); EDBQuery1.Prepare; EDBQuery1.ParamByName('Text1').AsString:='Some text'; EDBQuery1.ExecSQL; ShowMessage(EDBQuery1.ParamByName('ID').AsString); INSERT statements automatically set all parameters to IN/OUT so that any generated/computed column values (including IDENTITY columns) can be retrieved via the same parameters after the INSERT is executed. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, June 12, 2024 at 01:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |