Forum Discussion

Bishal's avatar
Bishal
Contributor
7 years ago
Solved

How to execute a SQL query which includes temp table ( creates and inserts ) - JDBC Step

  I have a JDBC test step with a SQL Query which  has a temp table on it. I am not able to execute this query. Every time i try to execute i get below XML response. Anyone has any idea? Thanks.    ...
  • Bishal's avatar
    Bishal
    7 years ago

    This is solved, i used

     

    def a = context.expand( '${DataSource#a}' )
    def b = context.expand( '${DataSource#b}' )

     

    sql.eachRow("""Declare @PortfolioOldCode varchar(3) = ${a},
    @EndDate Date = ${b},

     

    insted of 

     

    sql.eachRow("""Declare @PortfolioOldCode varchar(3) = context.expand( '${DataSource#a}' ),
    @EndDate Date = context.expand( '${DataSource#b}' )

     

    or

     

    sql.eachRow("""Declare @PortfolioOldCode varchar(3) = a,
    @EndDate Date = b

     

     

    -- Thanks for helping in guys