PostgreSQL | ||
---|---|---|
Prev | Next |
pg_select dbHandle queryString arrayVar queryProcedure
Specifies a valid database handle.
Specifies a valid SQL select query.
Array variable for tuples returned.
Procedure run on each tuple found.
the return result is either an error message or a handle for a query result.
pg_select submits a query to the Postgres backend. and returns the results. The queryString must be a select statement. Anything else returns an error. The arrayVar 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 indices.
set DB "mydb" set conn [pg_connect $DB] pg_select $conn "SELECT * from table" array { puts [format "%5d %s" array(control) array(name)] } pg_disconnect $conn
Prev | Home | Next |
pg_exec | Up | pg_result |