Solved

PB with a delete request !

Posted on 2002-07-01
5
288 Views
Last Modified: 2010-05-02
I try to kill recording in a table (about 65000) but the request not execute. The execution is stopped and an error returned to me: 3669.
This my code :

SQLB$ = ""
SQLB$ = "DELETE FROM TICKET "
SQLB$ = SQLB$ & "WHERE datediff(day,convert(dateTime,'01/01/2002'),dtcons)>=0 "
SQLB$ = SQLB$ & "AND datediff(day,convert(dateTime,'01/02/2002'),dtcons)<=0 "
Set ds_li2 = hdb.OpenRecordset(SQLB$, dbOpenDynaset, 0, dbOptimisticValue)
 
If somebody can help me! T
hank you in advance
 ankou
0
Comment
Question by:ldanet
  • 2
  • 2
5 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 7121771
SQLB$ = ""
SQLB$ = "DELETE FROM TICKET "
SQLB$ = SQLB$ & "WHERE datediff(day,convert(dateTime,'01/01/2002'),dtcons)>=0 "
SQLB$ = SQLB$ & "AND datediff(day,convert(dateTime,'01/02/2002'),dtcons)<=0 "
hdb.Execute SQLB$

Use the .Execute method of the database object rather than trying to open a recordset that returns no data.
0
 
LVL 3

Expert Comment

by:PNJ
ID: 7122264
Try deleting fewer rows at a time. It may be a problem with the database trying to save the deleted rows in a (hidden) temporary table in case you want to roll back the transaction - the table gets too big and exceeds its allowed temporary space.

Add: " AND ROWNUM < 1000" to the SQL

If that works, just keep running the SQL until no rows are deleted.
0
 

Author Comment

by:ldanet
ID: 7123978
Would have it a means to enlarge this temporary table!
If yes how to make to enlarge it?
Thank you in advance!
Being ankou
0
 
LVL 3

Accepted Solution

by:
PNJ earned 50 total points
ID: 7124098
I did some research on error 3669 and this is listed as "3669: Execution Cancelled". I have run into problems with large deletes with Oracle as mentioned above, but after some more research I came up with this link which points to timeout values being too short for long running queries: http://archives.postgresql.org/pgsql-interfaces/2001-03/msg00208.php (this site can be searched, so you may want to try for yourself as well. I found this site by using Google to search for "3669 error database").

Before you try the temp table space approach, I would investigate the timeout values first.
0
 

Author Comment

by:ldanet
ID: 7124113
Thank you very much for your precious help!
I am going now to try to resolve this problem by beginning with the timeout.
Still thank you!!!!!
ankou
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now