Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 21061

How do I Use a variable I created as a DB Query?

$
0
0

 

 

I THOUGHT I was doing things correctly... obviously not.

 

Given:

ManufacturingOrderIdSearchTextBox SetText "10008459" 

I wanted to change the 10008459 to the result of an SQL Query.(Which may, or may not, be the same)

First, created a variable...

Variables --> Right Click --> New Item

Change Name (Var1) to MyOrderNumber

Change Type (String) to DB Table

Click the elipsis  at the right of Default Value field and...

Select Database Query

Select Connection: Microsoft OLE DB Provider for SQL Server <Next>

1. Server Name :TestSQL

2. Use Windows NT Integrated Security

3. Select Database: production

Test connection: Test Connection succeeded (YEA!)

<OK><OK><Next>

Enter Query text:

SELECT TOP 1
mo.ManufacturingOrderId
FROM Production.ShopFloorControl.ManufacturingOrder_base mo
WHERE mo.HasBeenPrinted = 0
AND mo.ManufacturingStatusId < 5
AND mo.DateEntered > '2015-01-01'
AND mo.ManufacturingDueDate < '2049-01-01'
AND mo.isManaged = 1
order by mo.DateEntered desc

Click View Results:

2015-07-20_17-00-29.png

Happy Happy Joy Joy

click Finish

So... now I just have to USE the variable... this is NOT proving to be very do-able...

Tried: click on the set text Value field elipsis to open Operation Parameters

Clicked on the elipsis in the Value column to bring up edit parameter.

Mode:Variable

Value: KeywordTests.OPS_Manufacturing_Order_PORegression_Key.Variables.MyOrderNumber (Had to select from a dropdown)

 

When Run, I get an Exception: Type MisMatch...

BUT WAIT! (Next up, Solution!)


Viewing all articles
Browse latest Browse all 21061

Trending Articles