When using sqlite3 to create database tables, note that the sqlite3 Database

Source: Internet
Author: User

When using sqlite3 to create database tables, note that the sqlite3 Database

Note the following when using sqlite3 to create a database table:

1. Cannot use pure numbers

2. It cannot contain "-", "@", and other characters. Cannot start with a number.


1. The following information is output by log:

DB Error: 1 "unrecognized token:" 47464636265757265763393573649 ""

DB Query: insert into 47464636265757265763393573649 (role, number, name) values (?,?,?)

In fact, I want to use 47464636265757265763393573649 to indicate that it is actually not feasible. Cannot be a pure number

Ii. log below. I want to use the date as the table name.

DB Error: 1 "near" 2014 ": syntax error"

DB Query: insert into 2014-11-01-(role, number, name) values (?,?,?)

It means "-" is not acceptable.

III. The following log, I want to use uri as the table name:

DB Error: 1 "near": chat0015453d2792ef ": syntax error"

DB Query: insert into sip: chat0015453d2792ef@chat.xxx.com (role, number, name) values (?,?,?)

Note @ is also not acceptable

It is possible that the underlying layer of sqlite3 program the table name as a class name. Because the naming rules of tables are the same as those of variables.


How to access a table in the created sqlite3 Database

Assume that the data inventory is stored in the C root directory named db1.db, run cmd, and then
Input c:
Enter cd \
Input sqlite3 db1.db

Advice: I used sqlite3 to create a database and added some data to generate a db file.

You can create a database as a 64-bit operating system. When you open the database using SQLite expert personal 3, the database is opened based on a 32-bit operating system. Therefore, the system reports incompatibility!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.