Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating QTP Script to run on TOAD
#1
Not Solved
Hi Guys,

Can someone help me getting started in creating a QTP script that will run a query on TOAD or any other Oracle application

How can i connect to the DB with multiple instance

Thanks
Reply
#2
Not Solved
Can Someone help on this?? Is there any other automation tool that supports TOAD?

Thanks
Reply
#3
Not Solved
Hello ;

Here a exemple how using ODBC to connect to Orale database and execute and get the results:

Const adOpenStatic = 3
Code:
    Const adLockOptimistic = 3
    Const adUseClient = 3

    Set objConnection = CreateObject("ADODB.Connection")
    Set objRecordset = CreateObject("ADODB.Recordset")
    
    objConnection.Open "DRIVER={Microsoft ODBC for Oracle};Server=" & sG_Database & ";UID=" & sG_DBUser & ";PWD=" & sG_DBPwd
    objRecordset.CursorLocation = adUseClient
    objRecordset.CursorType = adopenstatic
    objRecordset.LockType = adlockoptimistic[hr]
This is the second part of the previeus script:

Code:
ObjRecordset.Source="Select column from Table " ' Exemple of Query'
    
ObjRecordset.ActiveConnection=ObjConnection
ObjRecordset.Open


If ObjRecordset.recordcount>0 then
i = 1                
Do Until ( i > iRowId Or ObjRecordset.EOF )

DataTable("Col" , dtGlobalSheet) = ObjRecordset("Column").Value
DataTable.SetCurrentRow (i)
ObjRecordset.MoveNext

i = i+1
Loop
End if
Remarke : Befor you can use this you have to install oracle ODBC client 10.2 for exemple if oracle database is 10.2 and less
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 583 11-05-2023, 03:55 PM
Last Post: lravi4u
  How do you Change Run mode mid script? Caleytown 6 7,191 03-25-2021, 08:27 AM
Last Post: RB26578
  How to run driver script to kick off scripts stored in QC? shipu 0 3,588 04-30-2014, 02:39 AM
Last Post: shipu
  Creating Random String SomeIntern 0 5,074 08-21-2013, 09:10 PM
Last Post: SomeIntern
  Flight API does not run and QTP not recording the script Ruch 0 2,593 08-15-2013, 04:57 AM
Last Post: Ruch

Forum Jump:


Users browsing this thread: 1 Guest(s)