tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
357 stars 99 forks source link

TDS_FDW - Question #163

Open oscarrfp opened 6 years ago

oscarrfp commented 6 years ago

I´m using TDW_FDW for postgresql

https://github.com/tds-fdw/tds_fdw

Is it possible to execute stored procedures from the link to sql server?

procedure that may or may not have variable input parameters

GeoffMontee commented 6 years ago

Hi @oscarrfp,

No, I don't think you can call remote stored procedures with tds_fdw at the moment. You probably can't even set a stored procedure as a table's query parameter, since FreeTDS uses a separate API for querying SPs than the one used for querying tables.

oscarrfp commented 6 years ago

Hi @GeoffMontee

Maybe you know of some other option to handle stored procedures?

thankful in advance

regards

4321ip commented 6 years ago

DROP FOREIGN TABLE IF EXISTS fdw_server.xxx; CREATE FOREIGN TABLE fdw_server.xxx (SRV_NAME text) SERVER server OPTIONS (query ' exec sp_linkedservers '); select * from fdw_server.xxx;

this work for me

ghost commented 5 years ago

@oscarrfp, did 4321ip's workaround help? If you aren't still having the issue please close this issue.