🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.database
Article #370

Re: QueryDataSet.deleteAllRows fails

#370
From: John Moore (TeamB)
Date: Fri, 08 Dec 2006 21:15
54 lines
2788 bytes
Whym,

Frankly I would never have included the line..

queryDataSet1.setResolver(new QueryResolver());

I default resolver is created as part of the QueryDataSet. Unless you 
require special resolution functions (which seems you do not) I don't 
see a reason for that line, (and it may be mucking things up..??)

Another possible addition is:

queryDataSet1.setRowId("CaseID", true);

It could be that the driver you are using is not reporting the metadata 
correctly and therefore you need to give DX a bit more help. Otherwise 
It will use ALL or SOME rows to locate the desired record to delete that 
are not really key fields, depending on what has been reported by the 
driver.  This is not a DX problem but a driver issue.

John...


Whym Junction wrote:
> I'm trying to empty a table with the following code (some lines
> regarding metadataupdate, tablename and rowid removed for brevity):
> 
> 
>         queryDataSet1.setQuery(new QueryDescriptor(database1, "select *
> from some_table", null, false,Load.ALL));
>         queryDataSet1.setResolver(new QueryResolver());
>         queryDataSet1.executeQuery();
>         queryDataSet1.deleteAllRows();
>         queryDataSet1.saveChanges();
> 
> The code raises a runtime DataSetException, error code BASE+38:
> More than one row was affected by resolution query:DELETE FROM
> `some_table`  WHERE `CaseID` = ?
> 
> I'm stumped. The resolution query seems OK. Did I forget something
> obvious? 
> 
> Thanks in advance,
> Wim
> 


-- 
=============================================
TeamB are volunteer helpers.  Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
http://www.microps.com/mps/paperFAQ.html
====================================================
Technical Details
Message-ID: <4579d5c6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <1165485180.366318.31740@80g2000cwy.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,1997d4d7825938bd
X-Google-Attributes: gid1073da,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 08 Dec 2006 13:15:39 -0800
From: "John Moore (TeamB)" <jbm@microps.com>
User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025)
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.database
Subject: Re: QueryDataSet.deleteAllRows fails
References: <1165485180.366318.31740@80g2000cwy.googlegroups.com>
In-Reply-To: <1165485180.366318.31740@80g2000cwy.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 207.137.13.178
Message-ID: <4579d5c6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1165612486 207.137.13.178 (8 Dec 2006 13:14:46 -0700)
Lines: 54
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail