Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
On 28 Aug 2017, at 2:50pm, Csányi Pál wrote: > If I open the Probe.db to edit in Midnight Comander, then I find there > one line only, which begin like: > SQLite format 3^@^P^@^A^A^@@ ^@^@^@^B^@^@^@^C^@^@^@^ ... etc... > > So it is definitely a database file and not a text file. You are correct. You now have a database file. > For newbies like me it should be mentioned Actually I can’t remember us having this problem posted before. If someone else comes up with the same problem the documentation should be changed. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
On 8/28/17, Csányi Pál wrote: > > When one finished entering SQL commands and used the ".quit" command > to exit the shell tool, then there will be not a text, but a database > file which can then be used on various devices, like smart phones, > etc. > correct -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
Hello Simon, 2017-08-28 15:28 GMT+02:00 Simon Slavin : > > On 28 Aug 2017, at 8:13am, Csányi Pál wrote: > >> I attach in this mail the Probe.db file to ask you to see it, whether >> is it really the database, or just a text file? > > This mailing list ignores attachments. To see if it’s a database just try to > open or type the file. If it’s all text, it’s not a database. If it has > weird characters in it it’s probably a database. > > Simon. I understand. If I open the Probe.db to edit in Midnight Comander, then I find there one line only, which begin like: SQLite format 3^@^P^@^A^A^@@ ^@^@^@^B^@^@^@^C^@^@^@^ ... etc... So it is definitely a database file and not a text file. For newbies like me it should be mentioned this at https://www.sqlite.org/quickstart.html bellow the 'Create A New Database' title, and below the line: Enter SQL commands at the prompt to create and populate the new database. like: When one finished entering SQL commands and used the ".quit" command to exit the shell tool, then there will be not a text, but a database file which can then be used on various devices, like smart phones, etc. No? -- Best, Pali ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
On 28 Aug 2017, at 8:13am, Csányi Pál wrote: > I attach in this mail the Probe.db file to ask you to see it, whether > is it really the database, or just a text file? This mailing list ignores attachments. To see if it’s a database just try to open or type the file. If it’s all text, it’s not a database. If it has weird characters in it it’s probably a database. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
2017-08-28 8:40 GMT+02:00 Simon Slavin : > > > On 28 Aug 2017, at 7:37am, J Decker wrote: > >> is redirection so hard? >> >> sqlite3 database.db < database.commands > > OP is learning and testing. If redirection doesn’t work, they don’t know > what’s wrong. The error messages in interactive mode are far clearer. > > Once they have the basic thing working, they can use interactive mode. Agree. But I did the redirection and get a Probe.db file, which is - I hope - the database and not a text file with commands. I attach in this mail the Probe.db file to ask you to see it, whether is it really the database, or just a text file? -- Best, Pali ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
On 28 Aug 2017, at 7:37am, J Decker wrote: > is redirection so hard? > > sqlite3 database.db < database.commands OP is learning and testing. If redirection doesn’t work, they don’t know what’s wrong. The error messages in interactive mode are far clearer. Once they have the basic thing working, they can use interactive mode. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
is redirection so hard? sqlite3 database.db < database.commands On Sun, Aug 27, 2017 at 10:31 PM, Simon Slavin wrote: > > > On 28 Aug 2017, at 6:25am, Csányi Pál wrote: > > > Probe.db is a list of SQL commands, stored as a text file, and not a > > SQLite database. > > Then please do not use a name for this file ending in ".db". It is not a > database. It is a list of commands. I suggest a name ending in ".txt" or > ".sql". > > > How can I get it in SQLite database, instead of just a text file with > > SQL commands? > > You start the sqlite3.exe program using the command > > sqlite3 Probe.db > > Once you have the "sqlite>" prompt, type those commands one by one. Or > you can instead use the ".read Probe.txt" command to process all commands > in the file. When you are finished use the ".quit" command to exit the > shell tool. > > Then look on your disk for the "Probe.db" file and it will the database > file. > > Simon. > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
On 28 Aug 2017, at 6:25am, Csányi Pál wrote: > Probe.db is a list of SQL commands, stored as a text file, and not a > SQLite database. Then please do not use a name for this file ending in ".db". It is not a database. It is a list of commands. I suggest a name ending in ".txt" or ".sql". > How can I get it in SQLite database, instead of just a text file with > SQL commands? You start the sqlite3.exe program using the command sqlite3 Probe.db Once you have the "sqlite>" prompt, type those commands one by one. Or you can instead use the ".read Probe.txt" command to process all commands in the file. When you are finished use the ".quit" command to exit the shell tool. Then look on your disk for the "Probe.db" file and it will the database file. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
Hello Simon, 2017-08-28 7:14 GMT+02:00 Simon Slavin : > > > On 28 Aug 2017, at 5:50am, Csányi Pál wrote: > >> When I am at sqlite> prompt, I enter SQL commands to create tables for >> the database Probe.db which is a file on my disk. >> >> In the Probe.db file are those SQL commands which I just entered and >> naturally these line at the beginning of the file: >> PRAGMA foreign_keys=OFF; >> BEGIN TRANSACTION; >> >> and at the end of file: >> COMMIT; > > There is something wrong with this description. You are talking about a file > "Probe.db" on your disk. But you describe two different contents for this > file as if they are the same thing. > > Is "Probe.db" a list of SQLite commands, stored as a text file, or a SQLite > database ? If it’s a SQLite database, can you given an example INSERT line > which was used to put data into this database ? Probe.db is a list of SQL commands, stored as a text file, and not a SQLite database. How can I get it in SQLite database, instead of just a text file with SQL commands? >> How can I convert this Probe.db file into format that an Android app can >> uses? > > The SQlite database format is identical on all platforms. You do not need to > do any conversion just because you move the database from a computer to a > phone. However, your description above makes me think you have just a list > of commands, not the database that these commands would make. Understand. Just want to get the SQLite database file, but not as a text file with SQL commands. How can I get it? -- Best, Pali ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Converting an sqlite database into format that an Android app can uses?
On 28 Aug 2017, at 5:50am, Csányi Pál wrote: > When I am at sqlite> prompt, I enter SQL commands to create tables for > the database Probe.db which is a file on my disk. > > In the Probe.db file are those SQL commands which I just entered and > naturally these line at the beginning of the file: > PRAGMA foreign_keys=OFF; > BEGIN TRANSACTION; > > and at the end of file: > COMMIT; There is something wrong with this description. You are talking about a file "Probe.db" on your disk. But you describe two different contents for this file as if they are the same thing. Is "Probe.db" a list of SQLite commands, stored as a text file, or a SQLite database ? If it’s a SQLite database, can you given an example INSERT line which was used to put data into this database ? > How can I convert this Probe.db file into format that an Android app can uses? The SQlite database format is identical on all platforms. You do not need to do any conversion just because you move the database from a computer to a phone. However, your description above makes me think you have just a list of commands, not the database that these commands would make. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Converting an sqlite database into format that an Android app can uses?
Hi, I am using sqlite3 on a command line, in an xterm window on Gentoo linux system. When I am at sqlite> prompt, I enter SQL commands to create tables for the database Probe.db which is a file on my disk. In the Probe.db file are those SQL commands which I just entered and naturally these line at the beginning of the file: PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; and at the end of file: COMMIT; Say I want to use this database in my Android application on my phone. How can I convert this Probe.db file into format that an Android app can uses? -- Best, Pali ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users