Forum Discussion

Rhonda_Ward's avatar
Rhonda_Ward
Occasional Contributor
13 years ago

Unable to insert properties into database using Datasink

Hi,

I am Unable to insert properties into database using Datasink. An "java.lang.Exception: SQL problem occured" exception is thrown when I try to do so.

Steps
1) Datasink step has the following properties

Property Name Value
duration = ${=testRunner.results[testRunner.results.size()-1].getTimeTaken()}
result_reason=${=testRunner.results[testRunner.results.size()-1].status}
target_name=${engineDataSource#endpoint}
test_case=engineSeverEST
test_result=0
test_run_id=1
test_step=${=testRunner.results[testRunner.results.size()-1].testStep.name}
test_suite=Engine EST

SQL Query:
insert into test_run_details(duration,result_reason,target_name,test_case,test_result,test_run_id,test_step,test_suite) values (?,?,?,?,?,?,?
,?);

When the test step is executed the "java.lang.Exception: SQL problem occured" exception was thrown.

Note:

I did try the sql query with quotes too
insert into test_run_details(duration,result_reason,target_name,test_case,test_result,test_run_id,test_step,test_suite) values ('?','?','?','?','?','?','?'
,'?');

Can you please help me determine the cause of failure?

Thanks

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Rhonda,

    can you check the error log at the bottom of the soapUI window to see if it contains more details on this error?

    regards,

    /Ole
    SmartBear Software
    • lappo76's avatar
      lappo76
      New Member

      I have the same issue. In the log it says:

       

      Mon Dec 18 11:13:25 CET 2017:ERROR:An error occurred [Parameter index out of range (1 > number of parameters, which is 0).], see error log for details

       

      insert into sys.sessions (sessionid)
      values ('${DataSink#sessionid}');