[sqlite] Characters corrupt after importing a CSV file

2015-03-01 Thread James K. Lowden
On Thu, 26 Feb 2015 10:58:30 + Adam Podstawczy?ski wrote: > While this solves the issue for me, I still believe this behavior is > confusing ? truncated characters should be handled more gracefully. To your point, I think the column and column-width features of the shell could benefit from

[sqlite] problem compiling std_call dll

2015-03-01 Thread James K. Lowden
On Sat, 28 Feb 2015 11:22:12 + Bart Smissaert wrote: > It doesn't compile and gives linking errors: > > Error 1 error LNK2001: unresolved external symbol > _sqlite3_db_filename > C:\Users\Bart\SQLiteForExcel\Source\SQLite3_StdCall > \SQLite3_StdCall.obj SQLite3_StdCall > Error 2 error

[sqlite] problem compiling std_call dll

2015-03-01 Thread Scott Robison
On Sun, Mar 1, 2015 at 10:55 PM, J Decker wrote: > On Sun, Mar 1, 2015 at 9:22 PM, Keith Medcalf wrote: > > > >I do not know if this is the case, but typically Windows creates names > > >like > > >_sqlite3_db_filename at X (where X is a number) if a function is defined > as > > >stdcall. It

[sqlite] problem compiling std_call dll

2015-03-01 Thread Scott Robison
On Sun, Mar 1, 2015 at 10:22 PM, Keith Medcalf wrote: > >I do not know if this is the case, but typically Windows creates names > >like > >_sqlite3_db_filename at X (where X is a number) if a function is defined as > >stdcall. It doesn't *have* to do this, but that's the convention used by > >

[sqlite] problem compiling std_call dll

2015-03-01 Thread Keith Medcalf
>I do not know if this is the case, but typically Windows creates names >like >_sqlite3_db_filename at X (where X is a number) if a function is defined as >stdcall. It doesn't *have* to do this, but that's the convention used by the @X is used to include the ordinal reference (@X) in the symbol

[sqlite] Does length() use strlen() on blobs?

2015-03-01 Thread David Barrett
Thank you everybody; casing to BLOB on insert is the solution I was looking for. This will ensure length() returns the number of bytes, which is exactly what I want. Thanks! -david On Sun, Mar 1, 2015 at 1:05 PM, Keith Medcalf wrote: > > length() on a blob returns the length of the blob

[sqlite] problem compiling std_call dll

2015-03-01 Thread J Decker
On Sun, Mar 1, 2015 at 9:22 PM, Keith Medcalf wrote: > >I do not know if this is the case, but typically Windows creates names > >like > >_sqlite3_db_filename at X (where X is a number) if a function is defined as > >stdcall. It doesn't *have* to do this, but that's the convention used by > >

[sqlite] Does length() use strlen() on blobs?

2015-03-01 Thread R.Smith
On 2015-03-01 08:40 PM, David Barrett wrote: > Hi! If I define a column as BLOB type, will length() run strlen() on the > data, or will it consult some kind of internal value to determine the > length? The documentation says: > > "For a string value X, the length(X) function returns the number

[sqlite] problem compiling std_call dll

2015-03-01 Thread Scott Robison
On Sun, Mar 1, 2015 at 9:28 PM, James K. Lowden wrote: > On Sat, 28 Feb 2015 11:22:12 + > Bart Smissaert wrote: > > > It doesn't compile and gives linking errors: > > > > Error 1 error LNK2001: unresolved external symbol > > _sqlite3_db_filename > >

[sqlite] Sqlite and threads/multiple applications

2015-03-01 Thread R.Smith
On 2015-03-01 11:22 AM, Olivier Vidal wrote: > ok, thank you Simon and Keith! > other people have experience with multiple applications/one sqlite > database? > > looking at this list , I > wonder if there is an operating system to favour with Sqlite.

[sqlite] Does length() use strlen() on blobs?

2015-03-01 Thread Simon Slavin
On 1 Mar 2015, at 6:40pm, David Barrett wrote: > I'm wondering if I insert > a string into that blob if it'll return the blob length or the string > length. You can put a value of any type into a column of any affinity. i.e. you can put a BLOB into a BLOB column or a string into a BLOB

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-01 Thread Richard Hipp
On 3/1/15, Paolo Bolzoni wrote: > Dear everyone, > > I find strange and confusing that bind indexes start from 1 (docs in > [1]) and instead column indexes start from 0 (doc in [2]). Is there > any technical reason or it is just an unlucky legacy? Seems like there was a reason for this, 11 years

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-01 Thread R.Smith
On 2015-03-01 04:41 PM, Paolo Bolzoni wrote: > Dear everyone, > > I find strange and confusing that bind indexes start from 1 (docs in > [1]) and instead column indexes start from 0 (doc in [2]). Is there > any technical reason or it is just an unlucky legacy? I'm going to venture a guess here

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-01 Thread Jay Kreibich
On Mar 1, 2015, at 5:33 PM, Richard Hipp wrote: > On 3/1/15, Paolo Bolzoni wrote: >> Dear everyone, >> >> I find strange and confusing that bind indexes start from 1 (docs in >> [1]) and instead column indexes start from 0 (doc in [2]). Is there >> any technical reason or it is just an

[sqlite] Why bind indexes start from 1 and column indexes start from 0?

2015-03-01 Thread Paolo Bolzoni
Dear everyone, I find strange and confusing that bind indexes start from 1 (docs in [1]) and instead column indexes start from 0 (doc in [2]). Is there any technical reason or it is just an unlucky legacy? Yours faithfully, Paolo [1] https://www.sqlite.org/c3ref/bind_blob.html [2]

[sqlite] Sqlite and threads/multiple applications

2015-03-01 Thread Simon Slavin
On 1 Mar 2015, at 9:22am, Olivier Vidal wrote: > looking at this list , I wonder if > there is an operating system to favour with Sqlite. Operating systems aren't a problem. Chose whatever OS you like based on other considerations. The same is true

[sqlite] Does length() use strlen() on blobs?

2015-03-01 Thread Keith Medcalf
length() on a blob returns the length of the blob without examining the blob itself. The length is encoded in the data structure. length() on text returns the number of characters in the text. This requires retrieving the data and counting. Whether sqlite stores a blob or text in the column

[sqlite] Does length() use strlen() on blobs?

2015-03-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/01/2015 10:40 AM, David Barrett wrote: > Hi! If I define a column as BLOB type, will length() run strlen() > on the data, or will it consult some kind of internal value to > determine the length? sqlite> select cast(x'424446' as text); BDF

[sqlite] Does length() use strlen() on blobs?

2015-03-01 Thread David Barrett
Hi! If I define a column as BLOB type, will length() run strlen() on the data, or will it consult some kind of internal value to determine the length? The documentation says: "For a string value X, the length(X) function returns the number of characters (not bytes) in X prior to the first NUL

[sqlite] Sqlite and threads/multiple applications

2015-03-01 Thread Olivier Vidal
ok, thank you Simon and Keith! other people have experience with multiple applications/one sqlite database? looking at this list , I wonder if there is an operating system to favour with Sqlite. I saw that there could be problems with older versions of

[sqlite] problem compiling std_call dll

2015-03-01 Thread Bart Smissaert
Iooked at that underscore (in _sqlite3_db_filename) as well, but that is just how VS presents the error, it didn't find a faulty underscore in the code. So, that is not it. As far as I can see the SQLite3 functions in this project are only in 3 places: sqlite3.h, SQLite3_StdCall.c and in the .def

[sqlite] problem compiling std_call dll

2015-03-01 Thread Teg
Hello Bart, dumpbin /all sqlite3.obj > sqlite.txt You can then look at the sqlite.txt file with a text editor. I found _sqlite3_db_filename listed in there a couple times. That tells you it was probably compiled in. If you can't find it then that could be part of the problem. Then I might dump

[sqlite] problem compiling std_call dll

2015-03-01 Thread Amit Chaudhuri
Bart, you say "don't know anything about C or C++ or compiling C code" Perhaps this will help. The error message (unresolved) external means that the linker is trying to find something (_sqlite3_db_filename in this case) but it cannot. Possible common causes include - it has been misspelt (I'm

[sqlite] With recursive question

2015-03-01 Thread Jean-Christophe Deschamps
Once again thank you very much Igor. I was making my life miserable trying to scan the "tree" from the other end. At 00:37 01/03/2015, you wrote: >It's a bit unfortunate that you made the root a parent of itself. >Forces the query to make an extra check to avoid infinite recursion. `---

[sqlite] With recursive question (addendum)

2015-03-01 Thread Jean-Christophe Deschamps
Forgot to mention that I sees the issue as fundamentally distinct from the Mandelbrot example in the SQLite docs: it uses a construct -outlined in procedural statements- like: For x in xRange For y in yRange compute something like f(x, y) -- here, y is independant of x Next y Next x

[sqlite] With recursive question

2015-03-01 Thread Jean-Christophe Deschamps
Dear list, After trying a number of ways I'm at loss solving the seemingly simple problem. For a simplified example say I have a list of individual filesystem directories with FK pointing to their parent: PRAGMA foreign_keys=ON; CREATE TABLE "Dirs" ( "DirID" INTEGER NOT NULL PRIMARY KEY,