July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Executing a command with libpgtcl is easy. You invoke the pg_exec procedure and you get back a result handle. pg_exec expects two parameters:
pg_exec connection_handle command
A typical call to pg_exec might look like this:
set result_handle [pg_exec $conn "SELECT * FROM customers"]
Calling pg_exec like this captures the result handle in the variable result_handle. A result handle encapsulates many items of information into a single object. You can't get at any of this information directly; instead, you have to use the pg_result procedure.
Let's look at some of the things that you can do with a result handle:
$ tclsh % package require Pgtcl % set connstr "host=davinci user=korry password=cows ...
Read now
Unlock full access