Query that receives input parameters

Hi everybody, I’m new here and I have a big doubt, I made an adapter service in which I have to receive an input parameter and I declared an input field called Department_ID, the problem is that I don’t know how write the SQL Query (a Select) because when I try to run it appears me an syntax error message. :frowning:

Please if somebody knows the correct syntax, could you help me?

Thnx guys :o

Hi Nina,
Can you tell what value you are expecting and what select sql you have written and what error you are getting??

Hi Nena,

The steps for creating a adapter service –

  1. create a adapter service from the context menu
  2. Table: Select the table.
  3. Joins: Select the joins ( if any )
  4. Select: the rows you wanted to select from the table
  5. Where: Select the column conditions. Here is where you have declare the input parameters. At the below block you find the creation of Input parameters. And be carefull of selecting the types ( use java.lang.string - only type understood my webMethods ). In the upper block( giving the conditions for a particular column, leave a ‘?’ in the input field, if you want to get tat value at the run time. And also the order of the parameters used here must be in the same order of the Input Parameters declared in the bottom block.
  6. Input/Output: Here you find the input parameter created in the above step.

you can also find this document helpful…

E:\webMethods711a_documentation\Adapters_and_eStandards\JDBC_6-5\6-5_JDBC_Adapter_Users_Guide.pdf

Thank you,
Naidu

Thnx for your answers, and Vikas I’m writing a query with the next code:

Select employee_id, department_id
from Employees where department_id = ?

somebody said me that the parameter is received with the symbol “?” and I’m expecting an integer value.

The error message that appear is:
" Could not run ‘Select2’
java.net.SocketException: Connection reset"

then if I close the msgbox appears a new message:

" Server connection to ‘localhost:5555’ lost: Try restoring session later "

and then the Integration Serves is stopped :sad:

and always is the same problem.

My adapter service is CustomSQL because I can’t use any other kind.

Hi Nena,
Problem is not with SQL syntax. Query is fine but it seems some connectivity error.

If your server is getting stopped every time when you are using JDBC Adapters then I would suggest reinstall you JDBC adapter properly and use ojdbc14.jar for connectivity.

Can you explain,what do you mean by you can not use any other kind?
Moreover if you only want to use custome SQL and wants input value at runtime then use below mentioned query.

Select employee_id, department_id from Employees where department_id=&departmentid
OR
Select employee_id, department_id from Employees where department_id like &departmentid