#include "ot4xb.ch" #include "libpq4xb.ch" function main() * Begin local conn := pqSetDbLogin("localhost","5432",NIL,NIL,"database","postgres",NIL) local result,query,n,nRows if ( PQstatus(conn) != ConnStatusType.Ok ) ? cPrintf( "Connection to database failed: %s", PQerrorMessage(conn) ) else query := "SELECT cliente_name ) FROM information_schema.tables " +; "WHERE table_schema = 'public'" result := pqExec(conn,query) nRows := pqntuples( result ) ? "TABLES: " for n := 1 to nRows ?? iif( n > 1 , ", " , "") ?? pqGetValue(result,n-1,0) next pqClear(result) ; result := NIL PQfinish(conn) end inkey(0) return NIL