Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Call Postgres function from Linked Server


  • From: "Jeff Crumbley" <jeffc(at)iilogistics(dot)com>
  • To: <pgsql-odbc(at)postgresql(dot)org>
  • Subject: Call Postgres function from Linked Server
  • Date: Thu, 17 Apr 2008 09:51:07 -0500
  • Message-id: <58748158EFB67344819B48564FCAD4A808119BBE(at)exchange2(dot)iilogistics(dot)com>

Not to be repetitive but I think my approach on this has changed from yesterday.

 

Using the Postgres ODBC driver (psqlodbc_08_03_0100) on windows, how do I pass the command to execute a Function on another machine? 

 

I am currently trying to execute the Function directly from SQL Server Query Manager like this “EXEC [PostgreSQL].dta.testuser.mssql_test” but get an error stating:

 

OLE DB provider "MSDASQL" for linked server "PostgreSQL" returned message "ERROR: syntax error at or near "1";

Error while executing the query".

Msg 7212, Level 17, State 1, Line 1

Could not execute procedure 'mssql_test' on remote server 'PostgreSQL'.

 

After corresponding with Hiroshi yesterday I now understand that the error is due to SQL Server trying to interpret the function call before it is handed off to ODBC, resulting in the error.

 

As a potential fix I thought using OPENQUERY might work but I don’t know the equivalent syntax to “EXEC [PostgreSQL].dta.testuser.mssql_test” to use to call a Function using OPENQUERY.

 

Any help anyone can provide would be appreciated.

 

Thanks,

 

JeffCrumble

 



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group