[sqlite] SQLite3 json functions with PHP on OS X

2016-04-13 Thread Fehmi Ozuseven
Hello, I need json functions badly in SQLite. I successfully installed the latest version of SQLite with "brew install sqlite3 --with-json1 --with-ft5" and now I can run json functions in console. But also I need to do that via PHP. So I installed php-sqlite with "sudo port install

[sqlite] Sqlite ODBC Query

2016-04-13 Thread Manasi Deshpande
Hello All, 1. RetCode = SQLExecDirect(hStmt, (SQLTCHAR*)query.c_str(), SQL_NTS); 2. When success RetCode = SQLFetch(hStmt); 3. if (SQL_SUCCEEDED(RetCode)) { While(SQLDescribeCol) { Switch(colDataType) { Case SQL_INTEGER: SQLGetData is called to fetch the data from stmt

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, Is it possible to get whether the column is set to autoincrement or not? PRAGMA table_info() does not give such info... Thank you.

[sqlite] SQLite3 json functions with PHP on OS X

2016-04-13 Thread Clemens Ladisch
Fehmi Ozuseven wrote: > I need json functions badly in SQLite. [...] > But also I need to do that via PHP. [...] The last thing I tried is > downloading php-7.0.5.tar.bz2 and trying compile sqlite in ext folder by > myself. [...] > Surprisingly it was work but it says SQLite Library Version

[sqlite] SQLite3 json functions with PHP on OS X

2016-04-13 Thread Richard Hipp
On 4/13/16, Clemens Ladisch wrote: > Fehmi Ozuseven wrote: >> I need json functions badly in SQLite. [...] >> But also I need to do that via PHP. [...] The last thing I tried is >> downloading php-7.0.5.tar.bz2 and trying compile sqlite in ext folder by >> myself. [...] >> Surprisingly it was

[sqlite] autoincrement

2016-04-13 Thread J Decker
Yes, you can get the create statement from sqlite_master table On Wed, Apr 13, 2016 at 4:54 AM, Igor Korot wrote: > Hi, > Is it possible to get whether the column is set to autoincrement or not? > > PRAGMA table_info() does not give such info... > > Thank you. >

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi,, On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: > Yes, you can get the create statement from sqlite_master table I was kind of hoping for a simpler solution so that not to parse "CREATE TABLE" statement... Well, I guess I will have to. Thank you. > > On Wed, Apr 13, 2016 at 4:54 AM,

[sqlite] Fwd: odd schema resulting from creating a table out of a join with a subselect

2016-04-13 Thread Hinrichsen, John
Hello all, The schemas generated by the last two joins below are not what I was expecting. Could someone point me to documentation on how the schema generation works when using a subselect in a join? This was tested on 3.7.17, 3.9.2, and 3.11.0, and the behavior is consistent across these three

[sqlite] Get fields type

2016-04-13 Thread hfiandor
Dear members: I have already obtained from a SQLQuery the field?s list. Now I need to obtain the field?s type, from the SQLQuery obtained from a SQLite table. I am thinking to obtain it introduced manually by the PC?s operators. The idea is to prepare an SQL?s sentence as INSERT INTO where I

[sqlite] autoincrement

2016-04-13 Thread Kees Nuyt
On Wed, 13 Apr 2016 10:58:54 -0400, Igor Korot wrote: > Hi,, > >On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: >> Yes, you can get the create statement from sqlite_master table > > I was kind of hoping for a simpler solution so that not to > parse "CREATE TABLE" statement... > > Well, I

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, Kees, On Wed, Apr 13, 2016 at 12:15 PM, Kees Nuyt wrote: > On Wed, 13 Apr 2016 10:58:54 -0400, Igor Korot > wrote: > >> Hi,, >> >>On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: >>> Yes, you can get the create statement from sqlite_master table >> >> I was kind of hoping for a simpler

[sqlite] Get fields type

2016-04-13 Thread Simon Slavin
On 13 Apr 2016, at 10:57am, hfiandor wrote: > I have already obtained from a SQLQuery the field?s list. Now I need to > obtain the field?s type, from the SQLQuery obtained from a SQLite table. In the SQLite API you would use this int

[sqlite] FTS5 query that to match all rows.

2016-04-13 Thread John Found
On Wed, 13 Apr 2016 23:38:04 +0700 Dan Kennedy wrote: > On 04/13/2016 11:24 PM, John Found wrote: > > What FTS5 query should I use in order to match all rows in the table? > > > > Can you use "SELECT * FROM fts_table;"? > *I* can. But the users of the program where I use SQLite can't simply

[sqlite] Get fields type

2016-04-13 Thread Paul Sanderson
you could use SQL i.e. select typeof(col1) from table1 would return text, integer etc. for each row in the table for the specified column. problems could arise if rows have NULL for given column or SQLite slack of strict column affinity mena sthat someone has dropped a string into an integer

[sqlite] Get fields type

2016-04-13 Thread Paul Sanderson
Or of course you could query the sqlite_master table Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit -Forensic Toolkit for SQLite email from a work address for a fully

[sqlite] autoincrement

2016-04-13 Thread Peter Aronson
There is one limitation to this approach, however. ?The entry for an autoincrement column in the sqlite_sequence table isn't made until the first row is inserted into the table. ?If you are also using the C interface, you can identify autoincrement columns using?sqlite3_table_column_metadata.

[sqlite] FTS5 query that to match all rows.

2016-04-13 Thread R Smith
On 2016/04/13 6:44 PM, John Found wrote: > On Wed, 13 Apr 2016 23:38:04 +0700 > Dan Kennedy wrote: > >> On 04/13/2016 11:24 PM, John Found wrote: >>> What FTS5 query should I use in order to match all rows in the table? >>> >> Can you use "SELECT * FROM fts_table;"? >> > *I* can. But the users

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, Peter, On Wed, Apr 13, 2016 at 1:16 PM, Peter Aronson wrote: > There is one limitation to this approach, however. The entry for an > autoincrement column in the sqlite_sequence table isn't made until the first > row is inserted into the table. If you are also using the C interface, you

[sqlite] Fwd: odd schema resulting from creating a table out of a join with a subselect

2016-04-13 Thread Hinrichsen, John
Hello all, The schemas generated by the last two joins below are not what I was expecting. Could someone point me to documentation on how the schema generation works when using a subselect in a join? This was tested on 3.7.17, 3.9.2, and 3.11.0, and the behavior is consistent across these three

[sqlite] Why SQLite allows to create table with unknown types?

2016-04-13 Thread Vladimir Soldatov
Hi all, Why create table request like 'CREATE TABLE perf1 (_id ANYANYANY, DATA1 TEXT, DATA2 TEXT);' is working well? The table is created, we can insert and delete rows. Btw, the programmer can do misprint like CREATE TABLE perf1 (_id INTEGERT, DATA1 TEXT, DATA2 TEXT) and everything will work

[sqlite] Why SQLite allows to create table with unknown types?

2016-04-13 Thread Simon Slavin
On 13 Apr 2016, at 4:56pm, Vladimir Soldatov wrote: > Why there is no data type checks to avoid such misprints? Please read this page then post again if you still have questions. Simon.

[sqlite] FTS5 query that to match all rows.

2016-04-13 Thread John Found
On Wed, 13 Apr 2016 19:41:34 +0200 R Smith wrote: > Or did you mean you publish an interface of sorts in your application > that allows users to run their own queries, but it /has/ to be an "fts5" > query in some way, and now sometimes they want to list all rows? It is > quite baffling - but

[sqlite] Why SQLite allows to create table with unknown types?

2016-04-13 Thread Igor Tandetnik
On 4/13/2016 11:56 AM, Vladimir Soldatov wrote: > Btw, the programmer can do misprint like CREATE TABLE perf1 (_id INTEGERT, > DATA1 TEXT, DATA2 TEXT) and everything will work well except very slow > delete operations. What makes you believe such a typo would affect performance in any way? It

[sqlite] Get fields type

2016-04-13 Thread hfiandor
Dear members: I use Lazarus for programing and SQLite tables. I?m trying to do an application for coping from Excel table to SQLite table. I have already identified both tables has the same field?s names and the order. But not yet I have obtained the field?s types in the SQLite table. Regards

[sqlite] autoincrement

2016-04-13 Thread R Smith
On 2016/04/13 4:58 PM, Igor Korot wrote: > Hi,, > > On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: >> Yes, you can get the create statement from sqlite_master table > I was kind of hoping for a simpler solution so that not to parse "CREATE > TABLE" > statement... > > Well, I guess I will

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, On Wed, Apr 13, 2016 at 1:54 PM, Igor Korot wrote: > Hi, Peter, > > On Wed, Apr 13, 2016 at 1:16 PM, Peter Aronson wrote: >> There is one limitation to this approach, however. The entry for an >> autoincrement column in the sqlite_sequence table isn't made until the first >> row is

[sqlite] autoincrement

2016-04-13 Thread Peter Aronson
The documentation for sqlite3_table_column_metadata C function can be found here; https://www.sqlite.org/c3ref/table_column_metadata.html. You just call it in turn on each column in a table (you can get the column names for a table by using Pragma table_info) and check the value of the 9th