Stored procedure as below. It is using a linked server to Oracle.
ALTER PROCEDURE [dbo].[SVOPS_ZsmartPaymentView]
(@param01 VARCHAR(255))
AS
BEGIN
SELECT *
FROM OPENQUERY(ZSMART_PROD, 'SELECT BANK_SN FROM CC.V_PAYMENT WHERE BANK_SN=''@param01''')
END
If I call the stored procedure with parameters as shown below, the result is empty:
EXEC [dbo].[SVOPS_ZsmartPaymentView] @param01 = 'T131612073600'
But if I run the statement directly like below, there is result.
SELECT *
FROM openquery(ZSMART_PROD, 'SELECT * FROM CC.V_PAYMENT WHERE BANK_SN=''T131612073600''')
Any idea why it returned empty result if executed using the stored procedure?