Re: [sqlite] Is there a way to select using cid?

2019-03-22 Thread Simon Slavin
On 22 Mar 2019, at 9:34pm, Peng Yu wrote: > There are cid's for each table. Is there a way to use "select" with > cid's instead of their names? In recent versions of SQLite you can use the result from pragma_table_info('test') as if it is a table. So you can do SELECT select * from

[sqlite] Is there a way to select using cid?

2019-03-22 Thread Peng Yu
There are cid's for each table. Is there a way to use "select" with cid's instead of their names? Thanks. $ sqlite3 dbfile

Re: [sqlite] Row locking sqlite3

2019-03-22 Thread Jens Alfke
> On Mar 22, 2019, at 1:38 PM, Barry Smith wrote: > > You might be interested in the BEGIN CONCURRENT branch. It does page level > locking (not quite as granular as row level). > > https://www.sqlite.org/cgi/src/doc/begin-concurrent/doc/begin_concurrent.md >

Re: [sqlite] Row locking sqlite3

2019-03-22 Thread Thomas Kurz
Ah, great, thank you very much for this information. - Original Message - From: Barry Smith To: SQLite mailing list Sent: Friday, March 22, 2019, 21:38:10 Subject: [sqlite] Row locking sqlite3 You might be interested in the BEGIN CONCURRENT branch. It does page level locking (not

Re: [sqlite] Row locking sqlite3

2019-03-22 Thread Barry Smith
You might be interested in the BEGIN CONCURRENT branch. It does page level locking (not quite as granular as row level). https://www.sqlite.org/cgi/src/doc/begin-concurrent/doc/begin_concurrent.md > On 22 Mar 2019, at 11:48 am, Thomas Kurz wrote: > > This sounds interesting. I have some

Re: [sqlite] Row locking sqlite3

2019-03-22 Thread Thomas Kurz
This sounds interesting. I have some questions about: > Row lock information is shared with processes. If a process finished > unexpectedly, unnecessary lock information might be stayed. In order to > unlock them, please use sqlumdash_cleaner.exe which clears all record > information. If there

[sqlite] sqlite3_set_auxdata has no effect during an insert

2019-03-22 Thread Jens Alfke
I have C functions that are invoked during queries. Some of these functions take parameter strings that need parsing, sort of like JSONPaths. I use sqlite3_set_auxdata to memoize the parsed versions of these. I just noticed that, when these functions are used in indexes — e.g. "CREATE INDEX

Re: [sqlite] shell session feature, #define awkwardness

2019-03-22 Thread Robert M. Münch
The docs at https://www.sqlite.org/compile.html state: „SQLITE_ENABLE_SESSION This option enables the session extension.“ which is not enough. You need to define SQLITE_ENABLE_PREUPDATE_HOOK too. Robert M. Münch On 8 Aug 2018, at 17:55, Larry Brasfield wrote: > In shell.c, #defining the

Re: [sqlite] Backing up a SQLite database without the CLI

2019-03-22 Thread Scott Perry
`ATTACH` and iterating over all tables with `INSERT INTO SELECT` is how `VACUUM INTO` is implemented (see src/vacuum.c). A less complicated way to back up the database might be to run `BEGIN` followed by `PRAGMA user_version` to acquire a read lock, after which you can safely copy the database

Re: [sqlite] library interfering with input function when running in python console

2019-03-22 Thread Jean-Luc Hainaut
On 20/03/2019 22:48, Anthony-William Thibault wrote: Hello there! Consider the following program Import sqlite3 x = Input("Enter your name”) print(“Hello, ” + x) When you run the code directly with python (double click the .py file or choose open with python) it won’t work Not surprising,

Re: [sqlite] cmd line question on import

2019-03-22 Thread Jose Isaias Cabrera
Windows 7, DOS command line. It works, thanks. From: sqlite-users on behalf of Simon Slavin Sent: Friday, March 22, 2019 11:15 AM To: SQLite mailing list Subject: Re: [sqlite] cmd line question on import On 22 Mar 2019, at 3:06pm, Jose Isaias Cabrera wrote: > I have a db in

Re: [sqlite] BUG - LEFT JOIN + IFNULL

2019-03-22 Thread Richard Hipp
On 3/22/19, Marek Šrom wrote: > > I found following bug, using SQLite version 3.27.2 on windows... > The following test script seems to work fine for me. create table test (a text); insert into test values(null); insert into test values('test'); create table test2 (b text); .mode quote .echo

Re: [sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread Richard Hipp
On 3/22/19, R Smith wrote: > On 2019/03/22 5:30 PM, Richard Hipp wrote: >> >> More recent versions of SQLite do issue a warning on the sqlite3_log >> interface if you use a double-quoted string literal. But not many >> people look at warnings, it turns out. > > > I don't see these in my logs

Re: [sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread R Smith
On 2019/03/22 5:30 PM, Richard Hipp wrote: More recent versions of SQLite do issue a warning on the sqlite3_log interface if you use a double-quoted string literal. But not many people look at warnings, it turns out. I don't see these in my logs from the standard sqlite3_log interface

Re: [sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread R Smith
On 2019/03/21 2:31 AM, Steve Horvath wrote: I found an issue with SQLite 3.27.2 and is also existent in 3.20.1. Of the four queries below, the second query should have returned the same result set as the first query. As a side note, I also tried creating the tables with no primary keys and got

Re: [sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread Richard Hipp
On 3/20/19, Steve Horvath wrote: > > I hope you have enough details to troubleshoot! > String literals in SQL should be enclosed in single-quotes, not double-quotes. 'WHITE', not "WHITE". Double-quotes are used to escape identifier names. This is standard SQL. When SQLite was first designed,

Re: [sqlite] library interfering with input function when running in python console

2019-03-22 Thread Mike King
I think this is a problem with the Python SQLite wrapper you are using not SQLite itself. Maybe a better place to ask would be on their mailing list. Also, consider giving a bit more detail as to why it fails as this may help them diagnose the issue. Cheers Mike On Fri, 22 Mar 2019 at 15:10,

Re: [sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread Simon Slavin
To quote a string in SQLite use apostrophes. This refers to a five character string: 'black' If you surround something with double quotes SQLite understands it as an entity name. Entities are things like tables and columns. So this is understood to be a column name: "black" . Because

Re: [sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread Shawn Wagner
Use single quotes, not double quotes, for strings. Double quotes are for identifiers. And you have a column named white... On Fri, Mar 22, 2019, 8:11 AM Steve Horvath wrote: > Hi, > > I found an issue with SQLite 3.27.2 and is also existent in 3.20.1. > > Of the four queries below, the second

Re: [sqlite] cmd line question on import

2019-03-22 Thread Simon Slavin
On 22 Mar 2019, at 3:06pm, Jose Isaias Cabrera wrote: > I have a db in c:\temp\sqliteDB.sqlite3 which has the Project_List table. I > can use, > > sqlite3 "c:\temp\sqliteDB.sqlite3" > > and copy and paste the content of the file, and it works fine. But I am > trying to do this from the

[sqlite] BUG - LEFT JOIN + IFNULL

2019-03-22 Thread Marek Šrom
Hello, I found following bug, using SQLite version 3.27.2 on windows... Using field from left joined table in ifnull when first row contains null value causes in following rows value to be empty string instead of correct value... To reproduce: create table

[sqlite] Incorrect result from INNER JOIN when column has a value of "WHITE"

2019-03-22 Thread Steve Horvath
Hi, I found an issue with SQLite 3.27.2 and is also existent in 3.20.1. Of the four queries below, the second query should have returned the same result set as the first query. As a side note, I also tried creating the tables with no primary keys and got the same results. I also tried using the

[sqlite] library interfering with input function when running in python console

2019-03-22 Thread Anthony-William Thibault
Hello there! Consider the following program Import sqlite3 x = Input("Enter your name”) print(“Hello, ” + x) When you run the code directly with python (double click the .py file or choose open with python) it won’t work However, the following code will work x = Input("Enter your name”)

[sqlite] cmd line question on import

2019-03-22 Thread Jose Isaias Cabrera
Greetings! I have this file, import.sql, which contains a structure like this, BEGIN; INSERT OR REPLACE INTO Project_List values ( ... ); ... ... INSERT OR REPLACE INTO Project_List values ( ... ); END; There are 253 INSERT OR REPLACE statements. What I am trying to do is to run it from the

[sqlite] Row locking sqlite3

2019-03-22 Thread Peng Yu
Hi, I see that sqlite3 still does not support row locking. This package tries to resolve this problem. But it does not have a standard build process for Linux. https://github.com/sqlumdash/sqlumdash/ Are there other packages similar to sqlite3 but support row locking? Thanks. -- Regards, Peng

Re: [sqlite] [EXTERNAL] Re: filling a key/value table

2019-03-22 Thread Hick Gunter
The declared type BLOB has the advantage of not messing around with the type of whatever is stored. Specifically, I have strings that look like 16 digit numbers, some with a leading zero, that would get clobbered by NUMERIC affinity; likewise, TEXT affinity would convert integers to text,