set pool "pg_flex" set db [ns_db gethandle $pool] set query [ns_db select $db "select count(*) from coa"] ns_db 0or1row $db $query set cnt [ns_set get $query cnt] ns_write "Retrieving $cnt records"