Set the encoding PRAGMA = "UTF-16" for the main database in sqlite

I read that after its creation it is impossible to change the text encoding of the database, and any attempt to do this will be ignored without pauses. (from here )

Frome this post , to create the main database, for example 'databasename.db' in SQLite, we need to enter the following command at the command prompt:

sqlite3 databasename.db

which creates the database and displays the 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 the PRAGMA encoding? How can I give a PRAGMA command before creating a database command, since the sqlite shell starts after creating the database command? Thanks in advance!

+3
2

sqlite3, . . . . . . .

sqlite3 test.db

sqlite,

pragma encoding=utf16;

.quit

sqlite, test.db

sqlite3 test.db

sqlite

pragma encoding = utf16;
pragma nnnn=xxx;

(), test.db -

create table test (testid integer);

, test.db

+6

SQLlite Browser . .

-2

All Articles