Usage of the command line program (CLP) in SQLite

Source: Internet
Author: User

SQLite CLP is the most common tool for using and managing SQLite databases. It operates in the same way on all platforms. CLP is actually twoProgramIt can run the query operation in interactive mode in shell mode, or it can run various database management tasks in command line mode.

1. CLP in shell mode

1) Open the shell and enter the temporary directory-Windows system to enter c: \ Temp or UNIX system to enter/tmp. If you work in a fixed directory, you can create an SQLite directory -- c: \ SQLite for Windows, And/SQLite for Linux and UNIX. This is the current working directory. All files created during the process of working with shell are located in this directory.

22.16.to open the clp's shellpattern, You can input sqlite3in the command line (you have already put sqlite3.exe in the system path, as described in the previous section). The command is followed by an optional database file name. If the database name is not specified in the command line, SQLite uses a memory database (the content will be lost when the CLP is exited ).

3) The CLP runs in interactive form. It can perform queries, obtain schema information, and import and export data and other database tasks. CLP uses any input statement as a query command, unless the command starts with a vertex (.), which is reserved for the specified CLP operation.

2. Command Line Mode CLP

1) You can use CLP from the command line to execute operations such as importing and exporting data, and return the result set and general batch processing. It is ideal to use shell scripts to automatically manage databases.

2) The CLP in the command line can accept the following parameters:

Optional list (optional)

Database File Name (optional)

SQL command to be executed (optional)

Except that init is a batch file for a specified SQL command, most options control output formatting. The database file name is required. SQL command is optional.

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.