Documentation Source Text
Check-in [12ac1ca27f]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:12ac1ca27ff6ff72c2a528f1d238bef185e5ef96
Date: 2013-03-18 21:05:08
User: drh
Comment:Use "package require" rather than "load" on the quick-start guide to using SQLite from TCL.
Tags And Properties
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/quickstart.in

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<ul>
<li><p>Below is a simple 
[http://www.tcl.tk | TCL program] that demonstrates how to use
the TCL interface to SQLite.  The program executes the SQL statements
given as the second argument on the database defined by the first
argument.  The commands to watch for are the <b>sqlite3</b> command
on line 7 which opens an SQLite database and creates
a new TCL command named "<b>db</b>" to access that database, the
invocation of the <b>db</b> command on line 8 to execute
SQL commands against the database, and the closing of the database connection
on the last line of the script.</p>

<blockquote><pre>
01  #!/usr/bin/tclsh
02  if {$argc!=2} {
03    puts stderr "Usage: %s DATABASE SQL-STATEMENT"
04    exit 1
05  }
06  load /usr/lib/tclsqlite3.so Sqlite3
07  <b>sqlite3</b> db &#91;lindex $argv 0]
08  <b>db</b> eval &#91;lindex $argv 1] x {
09    foreach v $x(*) {
10      puts "$v = $x($v)"
11    }
12    puts ""
13  }







|
|









|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<ul>
<li><p>Below is a simple 
[http://www.tcl.tk | TCL program] that demonstrates how to use
the TCL interface to SQLite.  The program executes the SQL statements
given as the second argument on the database defined by the first
argument.  The commands to watch for are the <b>sqlite3</b> command
on line 7 which opens an SQLite database and creates
a new object named "<b>db</b>" to access that database, the
use of the [eval method] on the <b>db</b> object on line 8 to run
SQL commands against the database, and the closing of the database connection
on the last line of the script.</p>

<blockquote><pre>
01  #!/usr/bin/tclsh
02  if {$argc!=2} {
03    puts stderr "Usage: %s DATABASE SQL-STATEMENT"
04    exit 1
05  }
06  package require sqlite3
07  <b>sqlite3</b> db &#91;lindex $argv 0]
08  <b>db</b> eval &#91;lindex $argv 1] x {
09    foreach v $x(*) {
10      puts "$v = $x($v)"
11    }
12    puts ""
13  }

Changes to pages/tclsqlite.in

1
2
3
4

5
6
7
8
9
10
11
12
<title>The Tcl interface to the SQLite library</title>
<tcl>
hd_keywords {Tcl extension} {TCL Interface}
proc METHOD {name text} {

  hd_puts "<a name=\"$name\"></a>\n<h3>The \"$name\" method</h3>\n"
  hd_resolve $text
}
</tcl>

<h1 align=center>The Tcl interface to the SQLite library</h1>

<p>The SQLite library is designed to be very easy to use from




>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
<title>The Tcl interface to the SQLite library</title>
<tcl>
hd_keywords {Tcl extension} {TCL Interface}
proc METHOD {name text} {
  hd_fragment $name [list $name method] [list TCL interface $name method]
  hd_puts "<h3>The \"$name\" method</h3>\n"
  hd_resolve $text
}
</tcl>

<h1 align=center>The Tcl interface to the SQLite library</h1>

<p>The SQLite library is designed to be very easy to use from