Re: [sqlite] SQLite error near "16": syntax error

2013-04-12 Thread Darren Duncan

On 2013.02.19 5:15 AM, mikkelzuuu wrote:

1-2-2013 16:58|H2|NL-Radio 2|2013-01-03T00:00:00.000Z|172806528

An example of the output that I have to do. I see the 16 s on the first cell
and the time, but I wouldn't know why its giving me an error there. Would I
have to change the setup of the Cell in my SQLite Database?


Your problem is that you are stitching together a line of programming code in 
the SQL language, and your data values are generally strings, but you are not 
quoting those strings.


The minimal change you want to make is:

string StrQuery = @"INSERT INTO Test VALUES ("' +
dataGridView1.Rows[i].Cells["Column1"].Value + "', '" +
dataGridView1.Rows[i].Cells["Column2"].Value + "', '" +
dataGridView1.Rows[i].Cells["Column3"].Value + "', '" +
dataGridView1.Rows[i].Cells["Column4"].Value + "', '" +
dataGridView1.Rows[i].Cells["Column5"].Value + "');";

-- Darren Duncan

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


Re: [sqlite] Sqlite in Google Summer of Code 2013

2013-04-12 Thread Simon Slavin

On 13 Apr 2013, at 2:23am, Roger Binns  wrote:

> On 15/02/13 04:56, Dann Luciano wrote:
>> ... or json results in sqlite.
> 
> Just formatting results as JSON is uninteresting and trivial.  It is a one
> liner in Python for example.
> 
> I use MongoDB for the vast majority of my database work these days.  The
> reason is because I can put arbitrary JSON objects in and get the same
> arbitrary JSON objects out.  Queries have the same "shape" as the JSON
> objects (unlike the defunct unql which tries to use SQL).

Since JavaScript can't talk to a SQLite database directly I have a little PHP 
servelet that does it for me.  The request is sent in JSON and the response is 
a JSON.stringified object with error codes and things like that in it.

(Before people chide me about SQL injections, the servelet checks the URL it's 
being called from /and/ refuses to run if the host of the caller isn't in my 
whitelist.)

To the OP: SQLite's greatest property ... okay, maybe the second greatest ... 
is that it's 'lite'. Attempts to add things to it are generally not welcome.  
It has no ambition to grow by gaining more and more functions, it has to run on 
tiny little embedded processors with no space to spare.

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


Re: [sqlite] Sqlite in Google Summer of Code 2013

2013-04-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 15/02/13 04:56, Dann Luciano wrote:
> ... or json results in sqlite.

Just formatting results as JSON is uninteresting and trivial.  It is a one
liner in Python for example.

I use MongoDB for the vast majority of my database work these days.  The
reason is because I can put arbitrary JSON objects in and get the same
arbitrary JSON objects out.  Queries have the same "shape" as the JSON
objects (unlike the defunct unql which tries to use SQL).

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlFos4AACgkQmOOfHg372QTmqwCfQOxLMP7JwM5WRk48mfCbwURa
bYwAoNfktyB7r+fGXosQ7ZKMoJfaKGIA
=CTqA
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite in Google Summer of Code 2013

2013-04-12 Thread Dann Luciano
Hi guys, what do you think about sqlite is part of the Google Summer of Code 
2013?

I'm interested in implementing some of the new features of postgres, like 
HashMaps, arrays, or json results in sqlite.

-- 
@dannluciano
Dann Luciano de Menezes

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


Re: [sqlite] ORDER BY finds "AS" names ambiguous that shouldn't be?

2013-04-12 Thread Richard Hipp
This issue is now recorded as http://www.sqlite.org/src/info/2500cdb9be

On Wed, Apr 10, 2013 at 4:39 AM, Perry Wagle  wrote:

> I have a problem with a field name being ambiguous when it wasn't before.
>  Is this a bug or a feature?
>
> Firefox 19 uses Sqlite 3.7.14.1 which does what it should.  Firefox 20
> uses Sqlite 3.7.15.2 which complains that "title" is ambiguous in the ORDER
> BY in the below query:
>
> SELECT (CASE bms.title ISNULL WHEN 1 THEN moz_places.url ELSE (CASE
> bms.title WHEN '' THEN moz_places.url ELSE bms.title END) END) AS title,
> (CASE moz_places.favicon_id ISNULL WHEN 1 THEN '' ELSE (SELECT
> 'moz-anno:favicon:' || moz_favicons.url FROM moz_favicons WHERE
> moz_favicons.id = moz_places.favicon_id) END) AS favicon, moz_places.url
> AS url, moz_places.visit_count AS visit_count, moz_places.frecency AS
> frecency, bms.id AS id, bms.dateAdded AS dateAdded, bms.lastModified AS
> lastModified, (SELECT max(visit_date) FROM moz_historyvisits WHERE place_id
> = moz_places.id) AS visit_date FROM (SELECT fk AS id FROM moz_bookmarks
> WHERE parent IN (6068538) GROUP BY fk HAVING count(*) = 1) AS t,
> moz_places, moz_bookmarks AS folders, moz_bookmarks AS bms WHERE t.id =
> moz_places.id AND t.id = bms.fk AND bms.parent = folders.id AND
> folders.parent != 4 GROUP BY bms.id ORDER BY title COLLATE NOCASE ASC,
> title COLLATE NOCASE ASC
>
> I claim "title" shouldn't be ambiguous, since the first SELECT expression
> was named "title".  What's the consensus?
>
> -- Perry Wagle (wa...@mac.com)
>
> PS.  The SQL is autogenerated, and I didn't write the generator.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


[sqlite] update record in contentless FTS4

2013-04-12 Thread Lukas Gebauer

Hello all!

I have contentless FTS4 index for searching some my external data 
paired by docid.

What I can do, when my existing previously indexed document was 
changed? I need to update existing FTS4 index too. But documentation 
says: "UPDATE and DELETE is not supported".

Can I do new INSERT with existing docid again? Or what I can do else?

Thank you for your help!

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


[sqlite] SQLite version 3.7.16.2

2013-04-12 Thread D. Richard Hipp
SQLite version 3.7.16.2 is now available on the SQLite website

   http://www.sqlite.org/

The 3.7.16.2 patch release contains a two-character change in the Windows OS 
interface that fixes a long-standing race condition that could lead to database 
corruption.   This bug has apparently existed in the code every since version 
3.0.0.  The corruption opportunity arises as follows:

(1) A process crashes or is killed while in the middle of a COMMIT, leaving 
behind a hot journal that needs to be recovered.
(2) Two or more new processes attach to the database and try to run the 
recovery at the same time.

If step (2) happens on a fast multi-core machine, and you are unlucky, then the 
xCheckReservedLock() method of the OS interface object might return a false 
positive result, deceiving one of processes into thinking that the recovery had 
already been accomplished and causing that process to delete the rollback 
journal and thereby corrupting the database.

Note that this flaw was present in the Windows interface only.  The unix/posix 
OS interface works correctly.  For unix, the only thing that has changed 
between version 3.7.16.1 and 3.7.16.2 is the version number.

This problem was found internally while conducting stress testing for other 
components of SQLite.  We have never received a report of database corruption 
from the wild that can be traced back to this flaw.  Nevertheless, it seems 
prudent to get a fix into circulation as quickly as possible.

Please send email to the SQLite users mailing list, or directly to me, if you 
encounter any problems with this release.
--
D. Richard Hipp
d...@sqlite.org



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


Re: [sqlite] sqlite port to android

2013-04-12 Thread Richard Allen
Or do you mean a sqlite console app?
On Apr 12, 2013 7:05 AM, "wookhee"  wrote:

> hi,
> I need some your help.
> I want to port a customized sqlite to android.
> How can I port it?
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/sqlite-port-to-android-tp68185.html
> Sent from the SQLite mailing list archive at Nabble.com.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite port to android

2013-04-12 Thread Richard Hipp
On Thu, Apr 11, 2013 at 9:27 AM, wookhee  wrote:

> hi,
> I need some your help.
> I want to port a customized sqlite to android.
> How can I port it?
>

Android has SQLite built in.


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


[sqlite] sqlite port to android

2013-04-12 Thread wookhee
hi,
I need some your help.
I want to port a customized sqlite to android.
How can I port it?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/sqlite-port-to-android-tp68185.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users