I have Action 1 where i am querying the db and getting a field which i am storing in the variable (lets say x). In Actions 2, i am again querying the db where i want to use the value stored in x in the where clause.
Snippet from Action 1:
SQL1 = " SELECT Identitynumber " &_
" FROM VLC_CRM.dbo.Person " &_
" WHERE Identitynumber = '" &IdentityNumber_ui&"'"
Set oRecordSet = oConnection.Execute(SQL1)
Do While NOT oRecordSet.EOF
IdentityNumber_db_tmp = CStr(oRecordSet.Fields("Identitynumber").Value)
IdentityNumber_db = RTrim(IdentityNumber_db_tmp)
oRecordSet.MoveNext
Loop
Action 2 SQL (i want to use IdentityNumber_db from Action 1 in my Where Clause below)
SQL1 = " SELECT TOP 1 CAST(la.LogonDate AS DATE) AS LogonDate," &_
" la.LogonDate AS LastLogonDateTime"&_
" FROM dbo.LogonAudit la" &_
" INNER JOIN dbo.Person p" &_
" ON la.EntityID = p.PersonID" &_
" WHERE p.IdentityNumber = '"&IdentityNumber_db&"'" &_
" ORDER BY LastLogonDateTime DESC"
Can someone please suggest how i can pass this value from Action 1 to Action 2 so i can use it in my SQL query?
Version: UFT 12.51
Use the syntax: RunAction strActionName, oneIteration, Param1, Param2
<Param1>
, <Param2>
is declared in your first Action, I called it Action1.Param1 = "a1_var1 --> from Action 1"