aboutsummaryrefslogtreecommitdiffstats
path: root/extension/testdbarray.awk
diff options
context:
space:
mode:
Diffstat (limited to 'extension/testdbarray.awk')
-rw-r--r--extension/testdbarray.awk21
1 files changed, 21 insertions, 0 deletions
diff --git a/extension/testdbarray.awk b/extension/testdbarray.awk
new file mode 100644
index 00000000..fd7fd595
--- /dev/null
+++ b/extension/testdbarray.awk
@@ -0,0 +1,21 @@
+@include "dbarray.awk"
+
+# $ ../gawk -f testdbarray.awk
+# $ ../gawk -f testdbarray.awk
+# ...
+# $ ../gawk -vINIT=1 -f testdbarray.awk
+
+
+BEGIN {
+ # bind array 'A' to the table 'table_A' in sqlite3 database 'testdb'
+ db_bind(A, "testdb", "table_A")
+
+ if (INIT) # detele table and start over
+ delete A
+
+ lenA = length(A)
+ A[++lenA] = strftime()
+ PROCINFO["sorted_in"] = "@ind_num_asc"
+ for (item in A)
+ print item, ":", A[item]
+}