Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to connect uft to oracle database?

4 Answer(s) Available
Answer # 1 #

For more information about the DATE data type, see Oracle Database SQL Language Reference.

For more information about the TIMESTAMP data type, see Oracle Database SQL Language Reference.

For information about the other time stamp data types and the interval data types, see Oracle Database SQL Language Reference.

The query in Example 2-18 uses the EXTRACT and SYSDATE functions to show how many years each employee in department 100 has been employed. The SYSDATE function returns the current date of the system clock as a DATE value. For more information about the SYSDATE function, see Oracle Database SQL Language Reference. For information about the EXTRACT function, see Oracle Database SQL Language Reference.

The query in Example 2-19 uses the SYSTIMESTAMP function to display the current system date and time. The SYSTIMESTAMP function returns a TIMESTAMP value. For information about the SYSTIMESTAMP function, see Oracle Database SQL Language Reference.

[5]
Edit
Query
Report
Ham pbabvswi Parmila
WELD INSPECTOR II
Answer # 2 #

I tried this two connection string:

1)DB_CONNECT_STRING = "Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & myHostName & ")(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=" & myServiceNameOrSID & "))); User ID=" & myUsername & ";Password=" & myPassword & ";"with this error

"OraOLEDB: ORA-12514: TSN: Listener dows not currently know of service requeste in connect descriptor".

2) "Driver={Microsoft ODBC for Oracle};Server=myServerName; Uid=your_username;Pwd=your_password;"

whit this error

"Microsoft OLE DB Provider: for ODBC Drivers: Data source name not found and no default driver specified".

This is my full code:

[5]
Edit
Query
Report
zjdyfrq Lloyd
ELECTRICIAN LOCOMOTIVE
Answer # 3 #

As such, QTP does not provide any built-in support to connect to database, however using VBScript testers will be able to connect and interact with databases using ADODB objects.

ADODB has 4 properties or methods with which we will be able to work with the databases. They are −

Databases can be connected using Connection strings. Each database differs in the way we connect to them. However, the connection strings can be built with the help of www.connectionstrings.com

Let us see how to connect to the database with the following parameters −

The output of the Query is shown in the SQL Server Management Studio as follows −

On executing the above script, the output is shown in the message box as shown below −

[4]
Edit
Query
Report
Taya Falcone
Geoff
Answer # 4 #
  • Create ADODB connection object.
  • Create Recordsetobject.
  • Connect to DB using provider and server.
  • Write the SQL Query.
  • Execute the query.
[3]
Edit
Query
Report
Lajwanti Keer
Emergency Medical Technician