
Passing Parameters into a SQL Query using OPENQUERY.
Below is the syntax for using OPENQUERY:
Code: Select all
SELECT * FROM OPENQUERY([AS400_Test], 'Select * From QS36FTEST.ZBBORDH') RS_ORHD
OPENQUERY is used through SQL Server to OPEN other ODBC sources within the SQL Server however when using OPENQUERY because of the single quotes the parameters do not work inside of the OPENQUERY. It appears that your component will not take into effect the single quotes. Is there a work around to using parameters with OPENQUERY?
Example:
Code: Select all
SELECT * FROM OPENQUERY([AS400_Test], 'Select * From QS36FTEST.ZBBORDH WHERE TEMP=:inTEMP') RS_ORHD
It appears your component does not reconize the parameter :inTEMP and is because the parameter is inside the single quotes of the OPENQUERY statement. Do you have a solution for this. Current we are re-writing each SQL statement on the fly however would like to use parameters.
Can you help?
