aboutsummaryrefslogtreecommitdiff
path: root/databases/sqlite/files/example.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'databases/sqlite/files/example.tcl')
-rw-r--r--databases/sqlite/files/example.tcl14
1 files changed, 14 insertions, 0 deletions
diff --git a/databases/sqlite/files/example.tcl b/databases/sqlite/files/example.tcl
new file mode 100644
index 000000000000..765c3f9ba715
--- /dev/null
+++ b/databases/sqlite/files/example.tcl
@@ -0,0 +1,14 @@
+package require sqlite
+
+if {$argc!=2} {
+ puts stderr "Usage: %s DATABASE SQL-STATEMENT"
+ exit 1
+}
+sqlite db [lindex $argv 0]
+db eval [lindex $argv 1] x {
+ foreach v $x(*) {
+ puts "$v = $x($v)"
+ }
+ puts ""
+}
+db close