Solved

PB with a delete request !

Posted on 2002-07-01
5
294 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

839 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