Re: [sqlite] How to determine the column type? – virtual table?

2019-12-14 Thread František Kučera
Dne 14. 12. 19 v 18:20 Richard Damon napsal(a): > What he wants is different. He takes a basically arbitrary database > (user provided) and an arbitrary SQL statement (also user provided) and > he wants to determine what type a given column will present. Yes, I am looking for something that is

Re: [sqlite] How to determine the column type? – explicit cast

2019-12-14 Thread František Kučera
P.S. Even if I do: SELECT cast(dump+100 AS integer) FROM fstab; the sqlite3_column_decltype() still does not return the integer type. Would it be possible to modify this function or add a new one, to tell the correct type at least if there is an explicit cast like this in given query? If I

Re: [sqlite] How to determine the column type?

2019-12-14 Thread František Kučera
Dne 14. 12. 19 v 9:36 Darren Duncan napsal(a): > With respect to SQLite, every column is the union of: Null, every Integer, > every Float, every Text, every Blob. OK, we can close this thread with that it is currently impossible to track the declared column types through relational operations.

Re: [sqlite] How to determine the column type?

2019-12-13 Thread František Kučera
Dne 14. 12. 19 v 0:09 Keith Medcalf napsal(a): > On Friday, 13 December, 2019 15:49, František Kučera > wrote: > >> I know that SQLite uses dynamic types, so it is not easy… But what is the >> best way to determine the column type of a result set? > Result sets do not ha

[sqlite] How to determine the column type?

2019-12-13 Thread František Kučera
Hello, I know that SQLite uses dynamic types, so it is not easy… But what is the best way to determine the column type of a result set? The sqlite3_column_decltype() works only if I select directly a column, but not when I do some other operations (call function, increment etc.). The

Re: [sqlite] Roadmap?

2019-10-27 Thread František Kučera
Dne 27. 10. 19 v 15:24 Simon Slavin napsal(a): > And I agree with you on RIGHT JOIN: it may duplicate what can be done with > LEFT JOIN but many SQL facilities are duplicates. It's in SQL92 and people > expect to see it. +1 This would increase portability of SQL scripts – it would be easier to

Re: [sqlite] Roadmap? - modular design

2019-10-27 Thread František Kučera
Dne 27. 10. 19 v 10:12 Thomas Kurz napsal(a): > at least some basic math would be very helpful as well. I don't want to > suggest a complete math support, that would really be far away from liteness Generally speaking, it might be difficult to say where is the line between „light“ and „heavy“.

Re: [sqlite] Stream loading SQL script

2019-10-26 Thread František Kučera
Dne 25. 10. 19 v 21:41 Keith Medcalf napsal(a): > The sqlite3 command line shell already does this. see function process_input Thanks, it helped. I see that it checks whether the input contains a semicolon and only then it calls sqlite3_complete(). So I implemented it in a similar way in C++.

Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread František Kučera
Dne 25. 10. 19 v 23:55 Thomas Kurz napsal(a) > this might be a stupid question, but do I have to use single or double quotes > when defining an alias? > > SELECT column1 AS 'c' > --or-- > SELECT column2 AS "d" > > On the one hand, the name refers to a column or table identifier. On the > other

[sqlite] Stream loading SQL script

2019-10-25 Thread František Kučera
Hello, I am developing a tool* in C++ and one of its features will be that it will load an SQL script (CREATE TABLE, INSERT), execute it, then execute some queries and print results. The SQL script might be long and I do not want to load it whole in the memory. Usually it will easily fit, but