软件测试开源工具Rational Robot SQABasic数据库操作相关命令[2] 软件测试工具
关键字:SQABasic 数据库 命令
注解:
对于SQL SELECT返回结果集的栏数目;对于UPDATE, INSERT, 或 DELETE返回受语句作用的行的数目。任何其它SQL语句返回0。如果函数在指定数据源不能执行此查询,或如果连接不可用,则返回为负的错误编码。
如果SQLExecQuery被调用但连接上还有一些未处理结果,则这些等待结果被新的结果所代替。 SQLExecQuery Example
This example performs a query on the data source.
Sub main
'' Declarations''
Dim connection As Long
Dim destination(1 To 50, 1 To 125) As Variant
Dim retcode As long
Dim outputStr as String
Dim query as String
'' open the connection
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
SQLGetSchema功能函数
文章来源于领测软件测试网 https://www.ltesting.net/