Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 6 of 6 total |
TEDBQuery - multiple statements |
Mon, Jul 7 2008 11:17 AM | Permanent Link |
Marcin | Hi
In DBISAM 4 I was able to execute query: INSERT INTO sources (source_name) VALUES ('test'); SELECT MAX(source_id) FROM sources; It allowed me to insert new row and return value of newly inserted column (source_id column is autoincremented). From documentation "The TEDBQuery component encapsulates a single SQL statement in ElevateDB" and I cannot execute above query. Instead I have to execute 2 queries or use TEDBStoreProc. With approach is more effective (it has to be speed optimized) or maybe there is another better one? Marcin |
Mon, Jul 7 2008 11:36 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Marcin
You could use a TEDBScript. But it would help us give advice if we knew what it was you were trying to achieve. Roy Lambert [Team Elevate] |
Mon, Jul 7 2008 12:00 PM | Permanent Link |
Marcin | Roy,
I have really simple dictionary table: CREATE TABLE sources ( source_id INTEGER GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1), source_name varchar(200), PRIMARY KEY (source_id) ) I want to insert a row into this table (just name of new source) and get value of source_id column for this new row. |
Mon, Jul 7 2008 12:10 PM | Permanent Link |
"Uli Becker" | Marcin,
if you use a script or a stored procdure you can use a param to get the new ID returned. Have a look here: http://www.elevatesoft.com/newsgrp?action=openmsg&group=17&msg=1433&page=2#msg1433 Uli |
Mon, Jul 7 2008 12:28 PM | Permanent Link |
Marcin | Thank you Uli
This is what I was looking for. Marcin. |
Mon, Jul 7 2008 1:50 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Marcin,
<< With approach is more effective (it has to be speed optimized) or maybe there is another better one? >> A script is most likely what you want. However, a good tip to remember is that you can load your old DBISAM-style scripts into a new script in the ElevateDB Manager, and then select Script from the main menu, and then Convert into Script from the Script menu, and it will automatically convert your DBISAM-style script into an ElevateDB script. Of course, in this case it is much more efficient to use an input/output parameter as Uli indicated in the link he included, as opposed to a SELECT MAX() query. DBISAM didn't have output parameters, so this wasn't an option. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |