易截截图软件、单文件、免安装、纯绿色、仅160KB

SQLite命令行程序说明

sqlite3: 一个SQLite数据库的命令行接口
译者注
原文地址:http://www.sqlite.org/sqlite.html
    SQLite库包含一个名字叫做sqlite3 的命令行,它可以让用户手工输入并执行面向SQLite数据库的SQL命令。本文档提供一个样使用sqlite3的简要说明。
开始
    启动sqlite3 程序,仅仅需要敲入带有SQLite数据库名字的"sqlite3 "命令即可。如果文件不存在,则创建一个新的(数据库)文件。然后sqlite3 程
序将提示你输入SQL。敲入SQL语句(以分号“;”结束),敲回车键之后,SQL语句就会执行。
    例如,创建一个包含一个表"tb11"名字为"ex1"的SQLite数据库,你可以这样做:
$sqlite3 ex1
SQLite version 3.3.17
Enter ".help" for instructions
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values('hello!', 10);
sqlite> insert into tbl1 values('goodbye', 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite>
   你可以通过敲你所用系统的文件结束符(通常是Ctrl + D)或者中断字符(通常是Ctrl + C)。来终止sqlite3程序。确定你在每个SQL语句结束敲入分号!
sqlite3程序通过查找分号来决定一个SQL语句的结束。如果你省略分号,sqlite3将给你一个连续的命令提示符并等你给当前的SQL命令添加更多的文字。这个特
点让你输入多行的多个SQL语句,例如:
sqlite> create table tbl2(
   ...> f1 varchar(30) primary key,
   ...> f2 text,
   ...> f3 real
   ...> );
sqlite>
题外话:查询SQLITE_MASTER表
SQLite数据库的框架被保存在一个名叫"sqlite_master"的特殊的表中。你可以像查询其它表一样通过执行“SELECT”查询这个特殊的表。例如:
$ sqlite3 ex1
SQlite vresion 3.3.10
Enter ".help" for instructions
sqlite> select * from sqlite_master;
    type = table
    name = tbl1
tbl_name = tbl1
rootpage = 3
     sql = create table tbl1(one varchar(10), two smallint)
sqlite>
    但你不能在sqlite_master表中执行诸如DROP TABLE, UPDA


相关文档:

Linux下创建数据库表(sqlite3)的脚本

本文以数据库中的数据表UserInfo为实例展示数据库表的创建及数据记录的录入。
#!/bin/sh
#variables definition
#database location
db=/conf/db
#
#create table userInfo
#name: User name
#passwd: Password
#Privilege: User privilege -- Administrator:0 Operator:1
#
echo "create table UserInfo(n ......

SQLite on BlackBerry 完美支持中文

在SQLite on BlackBerry上,JDBC访问数据库,缺省是以UTF-8保存数据到数据库里面的,每个中文通常是3个字节保存到数据库上面的。
  
例子代码参考:
BlackBerry sample - SQLiteDemo。
注意:在插入中文的时候,请使用Statement.bind指令,在我的测试中,可以很好的保存中文数据。读取的时候只需要使用Result ......

AutoIt3开发的操作SQlite数据库的源码

AutoIt3开发的操作SQlite数据库的源码下载
部分源码
_SQLite_Startup () ;加载 SQLite.dll
If Not FileExists($SQLite_Data_Path) Then
    SQLCreate()
EndIf
$GUI_Form = GUICreate($Title, 300, 435, -1, -1)
GUISetBkColor(0xECE9D8)  ; will change background color
$GUI_ListBox = GUIC ......

sqlite触发器一例

int column_names_printed = 0;
void print_row(int n_values, char** values)
{
    int i;
    for (i = 0; i < n_values; ++i) {
        printf("%10s", values[i]);
    }
    printf("\n& ......

一个关于SQLite小程序 ,请大家多多指教!

package com.jiao.sqlite;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widg ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号