Does anyone know how to use SQL command openquery in PowerBuilder DataWindow -> Data source?
I try to write it this way but it does not work:
(Error meessage: The argument (RETRIEVAL_ARGUMENT) defined for the select statement was not referenced)
DECLARE @Sql VARCHAR(8000), @MO varchar(10)
SET @MO =: RETRIEVAL_ARGUMENT
SET @Sql = 'SELECT fields FROM table WHERE field IN '+ @MO
SET @Sql = 'SELECT * FROM OPENQUERY(database, ''' + REPLACE(@Sql, '''', '''''') + ''')'
EXEC(@Sql)
How to define the retrieval argument correctly?
Thanks.
Peter
I try to write it this way but it does not work:
(Error meessage: The argument (RETRIEVAL_ARGUMENT) defined for the select statement was not referenced)
DECLARE @Sql VARCHAR(8000), @MO varchar(10)
SET @MO =: RETRIEVAL_ARGUMENT
SET @Sql = 'SELECT fields FROM table WHERE field IN '+ @MO
SET @Sql = 'SELECT * FROM OPENQUERY(database, ''' + REPLACE(@Sql, '''', '''''') + ''')'
EXEC(@Sql)
How to define the retrieval argument correctly?
Thanks.
Peter