軟件測試開(kāi)源工具Rational Robot SQABasic數據庫操作相關(guān)命令[5] 軟件測試工具
關(guān)鍵字:SQABasic 數據庫 命令
語(yǔ)法: 參數 解釋
connection& 必需項,long
destination$ 必需項,包含用來(lái)存儲結果的文件和路徑的字符串。
columnNames% 整型,非0時(shí),文件首行將存儲數據庫計劃指定的欄列名稱(chēng)。如果缺省,默認為0。
columnDelimiter$ 每行內界定域用的字符串。如果缺省,tab鍵用來(lái)分隔域。
注解:
成功完成操作情況下,返回值是結果集的行數目。如果函數不能在指定連接上獲得結果,返回-1。
參數是必需參數。返回變量。 SQLRetrieveToFile Example
This example opens a connection to a data source and retrieves information to a file.
Sub main
'' Declarations
''
Dim connection As Long
Dim destination As String
Dim retcode As Long
Dim query as String
Dim outputStr as String
Dim filename as String
Dim columnDelimiter as String
''
'' Open the connection
connection = SQLOpen("DSN=SblTest",outputStr,prompt:=3)
'' Execute the query
''
query = "select * from customer"
retcode = SQLExecQuery(connection,query)
'' Place the results of the previous query in the file named by
'' filename and put the column names in the file as the first row.
'' The field delimiter is %
''
filename = "c:\myfile.txt"
columnDelimiter = "%"
retcode = SQLRetrieveToFile(connection:=connection,destination:=filename, columnNames:=1,columnDelimiter:=columnDelimiter)
retcode = SQLClose(connection)
End Sub
文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/