Micro Focus QTP (UFT) Forums
how to pass an integer array variable in a query - 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: how to pass an integer array variable in a query (/Thread-how-to-pass-an-integer-array-variable-in-a-query)



how to pass an integer array variable in a query - sujaravi123 - 10-28-2011

Hi I need to pass an integer array element in a query

I have used the following statement


Code:
Set rs= gDBConnection.execute ( "SELECT CMPGN_DIM_ID   FROM STENCPS01.UDWHIT.CPS_ADVRTSNG_CMPGN_FACT where ADVRTSR_BRAND_DIM_ID in ("&array1(i)&")")

but it shows a run time error as

Error "SELECT CMPGN_DIM_ID FROM STENCPS01.UDWHIT.CPS_ADVRTSNG_CMPGN_FACT where ADVRTSR_BRAND_DIM_ID. "Found "(" at char 98) expecting an identifier found a keyword

Can some one help me to solve this error


RE: how to pass an integer array variable in a query - ravi.gajul - 10-28-2011

Looks like there is no syntax error as a Similar query in same format works fine for me
anyways try this

Code:
sqlquery="SELECT CMPGN_DIM_ID FROM STENCPS01.UDWHIT.CPS_ADVRTSNG_CMPGN_FACT where ADVRTSR_BRAND_DIM_ID in ("&array1(i)&")"
Set rs= gDBConnection.execute (sqlquery)


Regards,
Ravi