Solved

PB with a delete request !

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Access combo box help 2 47
Can we place a tooltip on the actual vb6 form 5 42
How to read File Date Created using VB6 8 39
IF ELSE Statement in Excel Macro VBA 16 64
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

777 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