Re: [sqlite] [sqlite-dev] Amalgamation code doesn't supoort limit on update / delete

2011-03-13 Thread Robert Hairgrove
On Sun, 2011-03-13 at 14:53 -0400, Pavel Ivanov wrote: 
> On Sun, Mar 13, 2011 at 2:46 PM, Steven Hartland 
>  wrote:
> > After spending many hours banging my head trying to figure out why
> > sqlite-jdbc was erroring on a delete with a limit even when compiled
> > with SQLITE_ENABLE_UPDATE_DELETE_LIMIT I finally tracked it down
> > to the fact that the Amalgamation download is simply missing half
> > the code to support it :(
> >
> > Compiling from standard source, in this case from FreeBSD ports
> > results in a sqlite3.c which has much more code that references
> > the options to support update / delete limits than the standard
> > Amalgamation version.
> >
> > I can't find anything that says this is a know limitation so can
> > only assume its an oversight / bug, is this the case?
> 
> http://lmgtfy.com/?q=SQLITE_ENABLE_UPDATE_DELETE_LIMIT+site%3Asqlite.org&l=1
> 
> If you look for description of SQLITE_ENABLE_UPDATE_DELETE_LIMIT on
> the resulting page you'll see that it's not a bug or oversight, it's a
> documented feature.

You could write something like this instead:

UPDATE some_table
SET some_field = ?
WHERE the_id IN (
  SELECT the_id 
  FROM some_table 
  WHERE [...] LIMIT [...]);

assuming that "the_id" is either the primary key column or else has a
unique index.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [sqlite-dev] Amalgamation code doesn't supoort limit on update / delete

2011-03-13 Thread Pavel Ivanov
http://lmgtfy.com/?q=SQLITE_ENABLE_UPDATE_DELETE_LIMIT+site%3Asqlite.org&l=1

If you look for description of SQLITE_ENABLE_UPDATE_DELETE_LIMIT on
the resulting page you'll see that it's not a bug or oversight, it's a
documented feature.


Pavel

On Sun, Mar 13, 2011 at 2:46 PM, Steven Hartland
 wrote:
> After spending many hours banging my head trying to figure out why
> sqlite-jdbc was erroring on a delete with a limit even when compiled
> with SQLITE_ENABLE_UPDATE_DELETE_LIMIT I finally tracked it down
> to the fact that the Amalgamation download is simply missing half
> the code to support it :(
>
> Compiling from standard source, in this case from FreeBSD ports
> results in a sqlite3.c which has much more code that references
> the options to support update / delete limits than the standard
> Amalgamation version.
>
> I can't find anything that says this is a know limitation so can
> only assume its an oversight / bug, is this the case?
>
>    Regards
>    Steve
>
>
> 
> This e.mail is private and confidential between Multiplay (UK) Ltd. and the 
> person or entity to whom it is addressed. In the event of misdirection, the 
> recipient is prohibited from using, copying, printing or otherwise 
> disseminating it or any information contained in it.
>
> In the event of misdirection, illegible or incomplete transmission please 
> telephone +44 845 868 1337
> or return the E.mail to postmas...@multiplay.co.uk.
>
> ___
> sqlite-dev mailing list
> sqlite-...@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users