Re: Test postresql databbase
Database tests are supported via odbc using the following functions: sqlopen, sqlclose, sqlerror, sqlretrieve, sqlretrievetofile, sqlexecquery, sqlgetschema and sqlrequest. You can carry out cursor type operations by incrementing arrays of returned datasets. All sql queries are supplied as a string. You can execute stored procedures for instance on sql server you could use “exec mystoredprocedure” and as long as that stored procedure is registered on the sql server database then it should execute however you cannot interact as much as you may like by supplying say in/out variables, etc but for most instances it will cover your database test requirements a sample database test could look like this: sub main ' declarations ' dim connection as long dim destination(1 to 50, 1 to 125) as variant dim retcode as long dim query as string dim outputstr as string connection = sqlopen("dsn=sbltest",outputstr,prompt:=3) ' ' execute the query query = "select * from customer" retcode = sqlexecquery(connection,query) ' retrieve the first 50 rows with the first 6 columns of each row into ' the array destination, omit row numbers and put column names in the ' first row of the array retcode = sqlretrieve(connection:=connection,destination:=destination, columnnames:=1,rownumbers:=0,maxrows:=50, maxcolumns:=6,fetchfirst:=0) ' get the next 50 rows of from the result set retcode = sqlretrieve(connection:=connection,destination:=destination,columnnames:=1,rownumbers:=0,maxrows:=50, maxcolumns:=6) ' close the connection retcode = sqlclose(connection) end sub
Re: Test postresql databbase
You have tools like pgbench available to test the performance for your postgresql database, make sure u change the required parameters to get the best performance after running your tests using pgbench.