Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 21 to 30 of 35 total |
Update statement very slow |
Sun, Sep 15 2013 6:13 PM | Permanent Link |
Fernando Dias Team Elevate | Uli,
I've done all the work, I only suggested things that didn't work Yeah, I'd like to hear Tim's opinion on this too. -- Fernando Dias [Team Elevate] |
Sun, Sep 15 2013 10:24 PM | Permanent Link |
Michael Riley ZilchWorks | Fernando Dias wrote:
> Discussions like this one are highly valuable - keeping these details > in mind can save us a lot of time. Thank you guys, mainly Uli for > bringing this up and sharing your conclusions. I totally agree. I was so inspired by Uli's question that I created two tables and populated them with lots of data just to play around with in EDB Manager. I never would have thought to do this on my own. tblParent (200,000) rows tblChild (820,000) rows -- Michael Riley GySgt USMC (Ret) www.zilchworks.com |
Mon, Sep 16 2013 4:01 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Uli
I know I'm late into this and you've found a solution but just to add the way I do it using a mix of Delphi & SQL: 1: use a query along the lines of qry1.sql.text := SELECT LIST(AnforderungenID,',') AD IDList FROM Anforderungen WHERE Datum >= date '2013-8-20' 2: Build the second query qry2,sql.text := 'UPDATE Leistungentest SET year = year + 1 WHERE AnforderungenID IN (' +qry1.fieldbyname('IDList').AsString+')' 3: Run qry2 Its also a technique I use to create "static" filters where I want to use other tables as part of the selection process. Roy Lambert [Team Elevate] |
Mon, Sep 16 2013 4:43 AM | Permanent Link |
Uli Becker | Roy,
> I know I'm late into this and you've found a solution but just to add the way I do it using a mix of Delphi & SQL: > > 1: use a query along the lines of qry1.sql.text := SELECT LIST(AnforderungenID,',') AD IDList FROM Anforderungen WHERE Datum >= date '2013-8-20' > 2: Build the second query > > qry2,sql.text := 'UPDATE Leistungentest SET year = year + 1 WHERE AnforderungenID IN (' +qry1.fieldbyname('IDList').AsString+')' > > 3: Run qry2 > > Its also a technique I use to create "static" filters where I want to use other tables as part of the selection process. Good solution also! Thanks. Uli |
Mon, Sep 16 2013 8:10 AM | Permanent Link |
Michael Riley ZilchWorks | Roy,
<< I know I'm late into this and you've found a solution but just to add the way I do it using a mix of Delphi & SQL: 1: use a query along the lines of qry1.sql.text := SELECT LIST(AnforderungenID,',') AD IDList FROM Anforderungen WHERE Datum >= date '2013-8-20' 2: Build the second query qry2,sql.text := 'UPDATE Leistungentest SET year = year + 1 WHERE AnforderungenID IN (' +qry1.fieldbyname('IDList').AsString+')' 3: Run qry2 Its also a technique I use to create "static" filters where I want to use other tables as part of the selection process. >> Thanks for that idea. I'll trying it within EDB Manager when I get home from work (in about 9 hours). I'd like to hear more about you create and use "static" filters but I don't think this thread is the appropriate place. Michael Riley GySgt USMC Retired www.zilchworks.com |
Mon, Sep 16 2013 8:27 AM | Permanent Link |
Michael Riley ZilchWorks | Roy,
I'm so glad IDE comes with syntax checkers cuz I suck at typing. I'd like to hear more about how you create and use "static" filters but I don't think this thread is the appropriate place. Michael Riley GySgt USMC Retired www.zilchworks.com |
Mon, Sep 16 2013 8:51 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Michael
I'll start a thread over in general Roy Lambert |
Mon, Sep 16 2013 6:26 PM | Permanent Link |
Michael Riley ZilchWorks | Roy Lambert wrote:
> I know I'm late into this and you've found a solution but just to add > the way I do it using a mix of Delphi & SQL: > > 1: use a query along the lines of qry1.sql.text := SELECT > LIST(AnforderungenID,',') AD IDList FROM Anforderungen WHERE Datum >= > date '2013-8-20' 2: Build the second query > > qry2,sql.text := 'UPDATE Leistungentest SET year = year + 1 WHERE > AnforderungenID IN (' +qry1.fieldbyname('IDList').AsString+')' > > 3: Run qry2 Roy, How would you do this in EDB Manager? -- Michael Riley GySgt USMC (Ret) www.zilchworks.com |
Tue, Sep 17 2013 3:22 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Michael
>> I know I'm late into this and you've found a solution but just to add >> the way I do it using a mix of Delphi & SQL: >How would you do this in EDB Manager? Since it involves a mix of Delphi & SQL I wouldn't When I'm testing a query of this nature I'd simulate it using a typed in IN statement. It should be possible to do the equivalent using a script. If I have time this weekend I'll see. Roy Lambert [Team Elevate] |
Tue, Sep 17 2013 8:52 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Michael
Had a few minutes to spare SCRIPT BEGIN DECLARE IDList VARCHAR DEFAULT ''; DECLARE ResultCursor CURSOR WITH RETURN FOR ResultStmt; EXECUTE IMMEDIATE 'SELECT LIST(CAST(_ID AS VARCHAR),'','') INTO ? FROM Companies WHERE _Name LIKE ''W%''' USING IDList; PREPARE ResultStmt FROM 'SELECT * FROM Companies WHERE _ID IN ('+IDList+')'; OPEN ResultCursor; END NOTE: _ID is an autoinc hence the CAST. Roy Lambert [Team Elevate] |
« Previous Page | Page 3 of 4 | Next Page » |
Jump to Page: 1 2 3 4 |
This web page was last updated on Tuesday, May 14, 2024 at 07:14 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |