3.SQL语句实例(从数据库表HR_LANGUAGE_TYPE中,查询字段语言名称LANGUAGE_NAME,条件语言名称=中文,按语言名称升序排序结果)
source(SQL语句):
SELECT HR_LANGUAGE_TYPE.LANGUAGE_NAME FROM dcwork.dbo.HR_LANGUAGE_TYPE HR_LANGUAGE_TYPE WHERE (HR_LANGUAGE_TYPE.LANGUAGE_NAME='中文') ORDER BY HR_LANGUAGE_TYPE.LANGUAGE_NAME
3.SQL语句实例
source:SQL语句
SELECT HR_LANGUAGE_TYPE.LANGUAGE_NAME FROM DB2ADMIN.HR_LANGUAGE_TYPE HR_LANGUAGE_TYPE WHERE (HR_LANGUAGE_TYPE.LANGUAGE_NAME='中文') ORDER BY HR_LANGUAGE_TYPE.LANGUAGE_NAME
三、Oracle格式:(本地需要安装Oracle ODBC DRIVER)
connectionstring(连接字符串):
1.本地没有创建数据源的方式
DRIVER={Oracle in OraHome92};SERVER=数据库服务名;UID=用户名WD=密码;DBQ=数据库名;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=FFC=10;TLO=O;
打开QTP
1.insert--checkpoint--database checkpoint
2.在弹出来的窗口选择第二项 specify SQL ....,然后点下一步,再点create
自己创建一下ODBC,如果能链通ORACLE,那在QTP回放应该没有问题
我的是LINUX AS4+ORACLE 10G
在QTP中的脚本是
Dim Cnn
Set Cnn = CreateObject("ADODB.Connection")
Cnn.C
Cnn.Open
If Cnn.State = 0 Then
Reporter.ReportEvent micFail, "testing", "连接数据库失败"
else
Reporter.ReportEvent micPass, "testing", "连接数据库成功"
end if
回放是通过的!
先确定你的ODBC能否正确连通先!
四 MYSQL格式:(本地需要安装MYSQL ODBC DRIVER)
Dim Cnn
Set Cnn = CreateObject("ADODB.Connection")
Cnn.C
Cnn.Open
If Cnn.State = 0 Then
Reporter.ReportEvent micFail, "testing", "连接数据库失败"
else
Reporter.ReportEvent micPass, "testing", "连接数据库成功"
end if
3.SQL语句实例
source:SQL语句
SELECT HR_LANGUAGE_TYPE.LANGUAGE_NAME FROM DCWORK.HR_LANGUAGE_TYPE HR_LANGUAGE_TYPE WHERE (HR_LANGUAGE_TYPE.LANGUAGE_NAME='中文') ORDER BY HR_LANGUAGE_TYPE.LANGUAGE_NAME