Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 8 of 8 total |
IF EXISTS 1.07 |
Sat, Dec 29 2007 11:14 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | I'm hoping that my favourite DBISAM sql enhancement is about to make its reappearance just before I start work on converting all my sql statements. Any chance?
Roy Lambert |
Sat, Dec 29 2007 12:32 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< I'm hoping that my favourite DBISAM sql enhancement is about to make its reappearance just before I start work on converting all my sql statements. Any chance? >> No, that's a major change that did not make it into 1.07. -- Tim Young Elevate Software www.elevatesoft.com |
Sat, Dec 29 2007 8:58 PM | Permanent Link |
DavidS | What does the If Exists function do? sounds like something I could be interested in
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote: Roy, << I'm hoping that my favourite DBISAM sql enhancement is about to make its reappearance just before I start work on converting all my sql statements. Any chance? >> No, that's a major change that did not make it into 1.07. -- Tim Young Elevate Software www.elevatesoft.com |
Sun, Dec 30 2007 4:57 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | DavidS
>What does the If Exists function do? sounds like something I could be interested in Its brilliant, probably the best single enhancement Tim could migrate from DBISAM. With it you can write statements (using the old DBISAM script format) like Changer.SQL.Add('ALTER TABLE IF EXISTS "CallMenu"'); Changer.SQL.Add('REDEFINE COLUMN IF EXISTS _Number _ID AUTOINC,'); Changer.SQL.Add('ADD COLUMN IF NOT EXISTS _Folder BOOLEAN AT 4,'); .... .... Changer.SQL.Add('ADD COLUMN IF NOT EXISTS _Analysis MEMO,'); Changer.SQL.Add('REDEFINE COLUMN IF EXISTS _Stats _Result VARCHAR(5),'); Changer.SQL.Add('ADD PRIMARY KEY (_ID)'); Changer.SQL.Add('NOBACKUP;'); Changer.SQL.Add('CREATE INDEX IF NOT EXISTS "BelongsTo" ON "CallMenu" (_BelongsTo);'); It saves the messing about with mixing SQL and Pascal and having to do a query to check if a table is there before you create it. Since I make heavy use of memory tables the TABLE level one is in my code all over. The nasty consequence is that you can no longer write sql and not care if a table or field is there knowing that the engine will take care of it and you now have to build the script in code checking the appropriate Information tables so the code is more complex, and a lot more work. By the time it does make it back (if ever) it'll be to late for a lot of people migrating apps. Roy Lambert |
Sun, Dec 30 2007 12:26 PM | Permanent Link |
DavidS | Roy,
I like this feature, and it would be great if it could be extended to values in field, IF Exists (select from tabel1 where id="4") but I think Tim has another way of doing this using row count. Roy Lambert <roy.lambert@skynet.co.uk> wrote: DavidS >What does the If Exists function do? sounds like something I could be interested in Its brilliant, probably the best single enhancement Tim could migrate from DBISAM. With it you can write statements (using the old DBISAM script format) like Changer.SQL.Add('ALTER TABLE IF EXISTS "CallMenu"'); Changer.SQL.Add('REDEFINE COLUMN IF EXISTS _Number _ID AUTOINC,'); Changer.SQL.Add('ADD COLUMN IF NOT EXISTS _Folder BOOLEAN AT 4,'); .... .... Changer.SQL.Add('ADD COLUMN IF NOT EXISTS _Analysis MEMO,'); Changer.SQL.Add('REDEFINE COLUMN IF EXISTS _Stats _Result VARCHAR(5),'); Changer.SQL.Add('ADD PRIMARY KEY (_ID)'); Changer.SQL.Add('NOBACKUP;'); Changer.SQL.Add('CREATE INDEX IF NOT EXISTS "BelongsTo" ON "CallMenu" (_BelongsTo);'); It saves the messing about with mixing SQL and Pascal and having to do a query to check if a table is there before you create it. Since I make heavy use of memory tables the TABLE level one is in my code all over. The nasty consequence is that you can no longer write sql and not care if a table or field is there knowing that the engine will take care of it and you now have to build the script in code checking the appropriate Information tables so the code is more complex, and a lot more work. By the time it does make it back (if ever) it'll be to late for a lot of people migrating apps. Roy Lambert |
Sun, Dec 30 2007 2:09 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | DavidS
That I think is already there. Here's Tim's example for replacing a JOIN in a DELETE sql delete from MemoryData.MemTimeOff M WHERE M.EmpID = 0 AND EXISTS (SELECT * FROM TimeKeeper.Timeoff T WHERE T.ReasonID = M.Reasonid and T.WeekDate = M.WeekDate and T.EmpID = -:EmpID) Roy Lambert |
Mon, Dec 31 2007 7:47 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | David,
<< I like this feature, and it would be great if it could be extended to values in field, IF Exists (select from tabel1 where id="4") but I think Tim has another way of doing this using row count. >> EDB already supports using the EXISTS function in this manner, but for some reason I just noticed that it isn't documented anywhere. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Jan 1 2008 7:04 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Tim
>EDB already supports using the EXISTS function in this manner, but for some >reason I just noticed that it isn't documented anywhere. Apart from these newsgroups Roy Lambert |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |