aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-11-08 01:10:15 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-11-08 01:10:15 +0000
commitd79bb2fd0ee968602421a1a8d87700204f070d52 (patch)
tree8a8d489065351cbe42cbf365b2c89b5178c5da7f
parent026387013e6a6e924889216f5524b2ddd942ca20 (diff)
downloadpostgresql-d79bb2fd0ee968602421a1a8d87700204f070d52.tar.gz
postgresql-d79bb2fd0ee968602421a1a8d87700204f070d52.zip
quick doc cleanup for libpgtcl from D'Arcy
-rw-r--r--doc/libpgtcl.doc21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/libpgtcl.doc b/doc/libpgtcl.doc
index 3ee5c6dfc09..ce7da7fc53e 100644
--- a/doc/libpgtcl.doc
+++ b/doc/libpgtcl.doc
@@ -17,6 +17,7 @@ The pgtcl package provides the following commands.
pg_connect - opens a connection to the backend server
pg_disconnect - closes a connection
pg_exec - send a query to the backend
+ pg_select - loop over the result of a select statement
pg_result - manipulate the results of a query
pg_lo_creat - create a large object
@@ -54,7 +55,25 @@ The pgtcl package provides the following commands.
the return result is either an error message or a handle for a query
result. Handles start with the prefix "pgp"
-4) pg_result: get information about a query result
+4) pg_select: loop over the result of a select statement
+
+ syntax:
+ pg_select connection query var proc
+
+ The query must be a select statement. Anything else returns an error.
+ The var variable is an array name used in the loop. It is filled
+ out with the result of the query for each tuple using the field
+ names as the associative indeces. Proc is the procedure that is
+ run for each tuple found.
+
+ example: (DB is set to database name)
+ set conn [pg_connect $DB]
+ pg_select $conn "SELECT * from table" array {
+ puts [format "%5d %s" array(control) array(name)]
+ }
+ pg_disconnect $conn
+
+5) pg_result: get information about a query result
syntax:
pg_result result ?option?