[sqlite] Minor SQLDIFF issue

2016-03-12 Thread Clemens Ladisch
tonyp at acm.org wrote: > Doing SQLDIFF against a non-existent database (e.g., due to a typo) produces > a diff which is a series of DROP TABLE ... and also creates an empty file by > that name. sqlite3_open() automatically creates the database file if it does not yet exist. (This is the only

[sqlite] Creating system table

2016-03-12 Thread Simon Slavin
On 12 Mar 2016, at 9:59pm, Clemens Ladisch wrote: > This is documented in the documentation: > http://www.sqlite.org/fileformat2.html#intschema To that documentation should be added sqlite_users. Simon.

[sqlite] Creating system table

2016-03-12 Thread Clemens Ladisch
Igor Korot wrote: > OK, so how many system tables SQLite has? This is documented in the documentation: http://www.sqlite.org/fileformat2.html#intschema Regards, Clemens

[sqlite] hexadecimal conversion on select query

2016-03-12 Thread J Decker
maybe ? https://www.sqlite.org/lang_corefunc.html hex(X)The hex() function interprets its argument as a BLOB and returns a string which is the upper-case hexadecimal rendering of the content of that blob. On Sat, Mar 12, 2016 at 12:18 PM, jungle Boogie wrote: > Hello All, > > I'm curious to

[sqlite] Minor SQLDIFF issue

2016-03-12 Thread to...@acm.org
Doing SQLDIFF against a non-existent database (e.g., due to a typo) produces a diff which is a series of DROP TABLE ... and also creates an empty file by that name. This is misleading as it looks like a possibly valid diff. Shouldn?t it instead give an error that there is no such database?

[sqlite] Creating system table

2016-03-12 Thread Clemens Ladisch
Igor Korot wrote: > There is a notion of system table vs. user table in the DBMS. System tables are tables with a name beginning with "sqlite_". > My question is: what should I do if I want to create a system table? This is possible only by (ab)using the writable_schema pragma: CREATE TABLE

[sqlite] Creating system table

2016-03-12 Thread Simon Slavin
On 12 Mar 2016, at 6:07pm, Igor Korot wrote: > There is a notion of system table vs. user table in the DBMS. > > The SQLite has at least 1 system table that is well-known: sqlite_master. There are other tables too: the ones made by ANALYZE which have names which start with 'sqlite_stat' .

[sqlite] Creating system table

2016-03-12 Thread Keith Medcalf
Why all the complication? You just need to set pragma writable_schema=1; so that you can create a table with an ill-advised name (starting with sqlite_). After it is created, it behaves just like any other table -- until you want to drop it -- that requires complication. SQLite version

[sqlite] Creating system table

2016-03-12 Thread Igor Korot
Hi, Clemens, On Sat, Mar 12, 2016 at 1:41 PM, Clemens Ladisch wrote: > Igor Korot wrote: >> There is a notion of system table vs. user table in the DBMS. > > System tables are tables with a name beginning with "sqlite_". > >> My question is: what should I do if I want to create a system table? >

[sqlite] Creating system table

2016-03-12 Thread Igor Korot
Hi, Simon, On Sat, Mar 12, 2016 at 1:18 PM, Simon Slavin wrote: > > On 12 Mar 2016, at 6:07pm, Igor Korot wrote: > >> There is a notion of system table vs. user table in the DBMS. >> >> The SQLite has at least 1 system table that is well-known: sqlite_master. > > There are other tables too: the

[sqlite] Creating system table

2016-03-12 Thread Igor Korot
Hi, ALL, There is a notion of system table vs. user table in the DBMS. The SQLite has at least 1 system table that is well-known: sqlite_master. My question is: what should I do if I want to create a system table? Thank you.

[sqlite] hexadecimal conversion on select query

2016-03-12 Thread jungle Boogie
Hello All, I'm curious to know if there's a better way to run a query and convert the results to hexadecimal. This is what I have so far: SELECT printf("%x %d",code,code), printf("%x", denom) FROM sidemeters order by denom The data is already in decimal so I don't necessarily need to include