I read that it is not possible to change the text encoding of a database after it has been created and any attempt to do so will be silently ignored.(from here)
Frome this post, to create main database,say 'databasename.db' in SQLite, we have to type following in command prompt :
sqlite3 databasename.db
which creates the database and displays sqlite shell as :
C:\Documents and Settings\Administrator>sqlite3 AudioData.db
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
In this case, how to set PRAGMA encoding ? How can I give PRAGMA command before create database command since the sqlite shell starts after create database command?? Thanks in advance!
You just call sqlite3 as you wrote. At this time there is just an empty file. Then you set your pragmas. The database with all its settings will be written after creating the first table. And the time of writing with all the environment variables is important. Just then the database is really created. So just set your pragmas before creating the first table.
e.g.
opens sqlite, nothing is written at that time
there is still nothing written
closes sqlite, an empty file test.db gets created
opens sqlite
sets the pragma(s), the file test.db is still empty
now the database gets really created and the database file test.db gets written with content
Use SQLlite Browser for such advanced functionalities. It is very straight forward to use.