Micro Focus QTP (UFT) Forums
Problem with Multiple rows retrieval from mySQL and save it some variable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Problem with Multiple rows retrieval from mySQL and save it some variable (/Thread-Problem-with-Multiple-rows-retrieval-from-mySQL-and-save-it-some-variable)



Problem with Multiple rows retrieval from mySQL and save it some variable - Dejavu - 03-14-2013

Scenario:
Code:
SELECT param.parameter_name, op.parameter_value
                                FROM t_automation_parameters AS param, t_automation_op AS op
                                WHERE op.parameter_id = param.parameter_id
                                AND op.order_id = (received_order_id)

Need to use the above query for mysql db which wud give me multiple rows and 2 columns. A key value kind of pairing.

e.g. Key”Manu”, Value”123456789”
Key”Adi”, Value”987654321”

I need to store it some variables but the key value pairing shud be intact and den wud work on the data and again need to update them in the DB.


RE: Problem with Multiple rows retrieval from mySQL and save it some variable - basanth27 - 03-15-2013

Use Dictionary objects.
Code:
set objGeneralDictionary=CreateObject("Scripting.Dictionary")
objGeneralDictionary.Add "Item", "Key"