Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 4 of 4 total |
DBISAM -> EDB: LASTAUTOINC |
Thu, Mar 12 2009 1:55 PM | Permanent Link |
Michael Fullerton | I have a DBISAM project I want to port to EDB. Problem is the coder
used several calls to LASTAUTOINC to get the last ID field in a table. I'm not sure how to do something similar in EDB. The help mentions FETCH but it doesn't work for me. Can some explain how to convert these statements in to EDB equivalents: select LASTAUTOINC("MyTable") from MyTable insert into RTable (ID, RDate) VALUES (LASTAUTOINC("MyTable "), :RDate) FETCH LAST from MyTable (ID) gives an error: ElevateDB Error #700 An error was found in the statement at line 1 and column 1 (Expected INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, GRANT, REVOKE, BACKUP, RESTORE, REPAIR, OPTIMIZE, IMPORT, EXPORT, DISCONNECT, REMOVE but instead found begin) Thanks in advance |
Thu, Mar 12 2009 2:38 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Michael
Does MAX(columnname) work for you? Roy Lambert |
Thu, Mar 12 2009 3:02 PM | Permanent Link |
Michael Fullerton | On Thu, 12 Mar 2009 18:38:11 +0000, Roy Lambert
<roy.lambert@skynet.co.uk> wrote: >Does MAX(columnname) work for you? It does indeed. Thanks Roy. |
Thu, Mar 12 2009 7:02 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Michael,
<< Can some explain how to convert these statements in to EDB equivalents: select LASTAUTOINC("MyTable") from MyTable insert into RTable (ID, RDate) VALUES (LASTAUTOINC("MyTable "), :RDate) >> If you simply want to get the last identity value for an inserted row, then the easiest way to do this is with a paramterized INSERT statement: http://www.elevatesoft.com/newsgrp?action=openmsg&group=17&msg=2164&page=1#msg2164 -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |