Forum Discussion

prouser's avatar
prouser
Contributor
12 years ago

How to run JDBC test step when passing prepared sql stmt

Hi I am new to using Soap UI Pro
Could anyone tell me if it is valid to pass a prepared sql statement from groovy tests step to JDBC test step using Property Expansion

The Groovy test step result has my prepared sql stmt,
"SELECT I_Name"+
" FROM BC."+
cctbl+
" WHERE I_ID='xxxx'"
Note: cctbl is a variable that is defined prior to this statement

I have the following in the "SQL Query" field of my JDBC test step:: context.expand( '${Groovy#result}' )

When I run my JDBC test step, I am getting the following error
ERROR:com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][10425][12538][3.61.65] Invalid input CALL SQL syntax. SQL= call context.expand( 'SELECT I_Name FROM BC.VISA_TR_N WHERE I_ID='xxx'' ) ERRORCODE=-4463, SQLSTATE=42601

1 Reply

  • I resolved this

    I now have the following in the "SQL Query" field in my JDBC test step:: ${Groovy#result}

    without any quotes around it and it is working prefect

    Thanks