How to Convert SQLite to Text
- 1). Load a SQLite database and enter the sqlite3 environment by typing the following text at the command prompt:
$ sqlite3 mydb.db
Replace "mydb.db" with the name of your database. A database with the specified name will be created if none already exists. - 2). Convert a value to the TEXT data type with the "CAST" expression by typing the following command at the command prompt:
$ sqlite3 my_db.db INSERT INTO my_table VALUES(CAST(97 AS TEXT))
Replace "my_table" with the name of your table. In the code, the number 97 is inserted into the table as a TEXT value. - 3). Exit the sqlite3 environment by typing ".quit", ".q" or ".exit." and pressing the "Enter" key.