QTP Forums

Full Version: how to pass an integer array variable in a query
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I need to pass an integer array element in a query

I have used the following statement


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
Looks like there is no syntax error as a Similar query in same format works fine for me
anyways try this

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
Reference URL's