GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 606 of 684    Print  
How to Pass variable in the sql query when creating DB Checkpoint
How can we pass a variable while creating a DB checkpoint. Is it even possible ?

I would like to do something like

QTP script
variablename=somevalue

DB Checkpoint query:
select * from table where col=variablename

instead of doing
select * from table where col=123

Thank you
Sairam



  
Total Answers and Comments: 2 Last Update: April 25, 2008     Asked by: sairam100 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 23, 2007 02:07:41   #1  
ramugogurla Member Since: January 2007   Contribution: 14    

RE: How to Pass variable in the sql query when creating DB Checkpoint
hi sriram

i think we can pass variables from dataatble

select* from table where datatable.value
("columnno" 1)

 
Is this answer useful? Yes | No
April 25, 2008 05:21:28   #2  
amninder Member Since: April 2008   Contribution: 3    

RE: How to Pass variable in the sql query when creating DB Checkpoint
Set con createobject("ADODB.Connection")
con.connectionstring "DSN QT_Flight32;DBQ C:Program FilesMercury InteractiveQuickTest Professionalsamplesflightappflight32.mdb;Driver C:WINDOWSsystem32odbcjt32.dll;DriverId 281;FIL MS Access;MaxBufferSize 2048;PageTimeout 5;"
con.open()
var 2
Set rcrecordset con.execute("select * from Orders where Order_Number " &var & "")
rcrecordset.movefirst
msgbox rcrecordset.fields(0) & rcrecordset.fields(1)
Set rcrecordset nothing
con.close
Set con nothing

you can also use datatable to parameterize the sql query

 
Is this answer useful? Yes | No

 Related Questions

Answer posted by shreethik on 2005-06-09 08:36:38: Output values enable to view the values that the application talkes during run time.When paramaterised, the values change for each iteration.Thus by creating 
Latest Answer : By using Text Output value we can capture a runtime value form the application under test and store it in a variable or in a localsheet ...

These are the new features which are available in QTP8.2 and which are not present in 6.5 version.Keyword View: Lets you easily build and maintain tests without writingVBScripts.Auto-Documentation: Provides 
Latest Answer : Really great help,Thanks ...
Read Answers (2) | Asked by : James

Explain the process of creating a test for an xml file which is uplaoaded in the application where it is validated?
Read Answers (2) | Asked by : chaw

Latest Answer : Assign the value of the checkpoint result to a variable. Chek the variable and if it is true, Use ExitTest to exit the testResult=Browser(...).Page(...).CHeck(Checkpoint())If Result thenExitTestEnd if ...
Read Answers (2) | Asked by : Jacob Kreuzfeld

How to add a failure from a VBscript function to the results. how can I implement the functionality of checkpoint functionality from by VBScript. For Ex: I want to record a failure if some calculations evaluate to false.
Read Answers (2) | Asked by : Ashok

Latest Answer : the syntax of Database Check point isDbTable.check checkpoint("DbTable")DbTable is nothing but Data Table which contains all info.regarding databaseRegardsNag ...
Read Answers (2) | Asked by : shital

Where is the bitmap checkpoint information saved? a) In Temporary folder b) In resource.mtr under action folder c) In the Script.mts folder under the action folder d) In the checkpoint.usr file

1. what are the actions available in QTP?2. What is environmental variable? How many types available in QTP?
Read Answers (5) | Asked by : Trushar Shah

Latest Answer : There are many ways to send data.Test 1:Create Environment variable in action1 and make that action resuable.Test 2:Create action2 and use the variable.When more data needs to be send we can pass the entire data to excel sheet and we can retrieve that ...

Latest Answer : Set dbexample = CreateObject("ADODB.Connection") dbexample.Open "dsn=;" & _ "uid=;" & _ "pwd=;" strRequiredNameCode = DataTable.Value("strRequiredNameCode")sql = "Select Name from ORGANIZATION ...


 Sponsored Links

 
Related Articles

Creating XML with the DOM PHP Extension

Creating XML with the DOM PHP Extension In fact the PHP DOM extension is a set of classes that can be used to generate access and manipulate XML data The DOM php script defined in the following listing shows how to generate an XML document based on the result set retrieved from the database mosgoogl
 

SQA Software and Tools

SQA Software and Tools In quality assurance it is always important to get all the help we could get In other industries developers could easily check the products manually and discard those that do not meet the standard The length and the width of the product are checked to maintain standardization
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Creating Virtual Business Network

Requirements of Virtual Business Network The sudden expansion of electronic commerce has resulted in many changes in the way business is done globally The virtual business network is the buzz word among the business communities internet community and freelance work seekers Traditional business strat
 

Business Network Virtual Communication Tools

Business Network Virtual Communication Tools Since ages the Business community heavily relied on face to face communication for building Business relationships Face to face communications formed the basis for trust in a relationship An individual’ s appearance or the physical appearance of
 

What are Data Access Tools

Data access is the process of entering a database to store or retrieve data. Data Access Tools are end user oriented tools that allow users to build structured query language (SQL) queries by pointing and clicking on the list of table and fields in the data warehouse. Thorough computing history, t
 

What is an Ad Hoc Query

An Ad-Hoc Query is a query that cannot be determined prior to the moment the query is issued. It is created in order to get information when need arises and it consists of dynamically constructed SQL which is usually constructed by desktop-resident query tools. This is in contrast to any query which
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(“%d”,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

Testing and Integration

Once the software is complete, it will go though rigorous testing before its actual integration.  In this article we will take a look at different types of software testing and also different types of integration. With the diversity of business setting and software development models, it al
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape