BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detecting missing records

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Tumurbaatar S.
Guest





PostPosted: Mon Mar 21, 2005 4:08 am    Post subject: Detecting missing records Reply with quote



A SQL2K db has a table which contains a datetime field. Some app
adds a new record every N minutes and a current time is saved in above
datetime field. To detect whether the app failed or something occurred
that a record was not added, I'm planning to use below query:

SELECT * FROM tbl o WHERE NOT EXISTS (SELECT * FROM tbl i
WHERE i.dt_field = DATEADD(minute, N, o.dt_field))

It seems that works well and if there's no missing record, the query
returns the last inserted record only.
But there's one problem. The above query uses SQL2K function DATEADD(),
but I need something universal which works on every ADO/OLEDB compliant
RDBMS. Any ideas?


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.