Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Odbc > Re: Linked Serv...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 2343 of 2443
Post > Topic >>

Re: Linked Server Error

by z-saito@[EMAIL PROTECTED] ("Hiroshi Saito") Apr 17, 2008 at 06:58 AM

Hi.

In it, "AS" key word was an indispensable reason and a problem. However,
it becomes possible because it was equipped from version8.4 of server. 
See,
http://winpg.jp/~saito/psqlODBC/SQLServer_linkserver_PostgreSQL2.png

Regards,
Hiro**** Saito

"Jeff Crumbley"
>To whom it may concern:
>
> 
>
>I am running SQL Server on Windows 2003 R2 (32-bit) connecting to
>Postgres on SCO Unix.  I have installed the ODBC driver
>(psqlodbc_08_03_0100) and can query the tables in Postgres using
>OPENQUERY from SQL Server.  Everything works great where this is
>concerned.
>
> 
>
>The issue I am having involves calling a Postgres Function from SQL
>Server.  The user ID that I am using to connect to Postgres is a
>SuperUser and the function I created in Postgres is accepted without a
>error (in pgAdmin III).  
>
> 
>
>The Function:
>
>-------------------------------------------------------
>
>CREATE OR REPLACE FUNCTION mssql_test()
>
>  RETURNS integer AS
>
>$BODY$DECLARE
>
>                retval bigint;
>
>BEGIN
>
>                retval:=(SELECT count(*) FROM dminvoice);
>
>                return retval;
>
>END;$BODY$
>
>  LANGUAGE 'plpgsql' VOLATILE;
>
>ALTER FUNCTION mssql_test() OWNER TO testuser;
>
>GRANT EXECUTE ON FUNCTION mssql_test() TO public;
>
>GRANT EXECUTE ON FUNCTION mssql_test() TO testuser;
>
> 
>
>The way I am calling the function is as follows:
>
> 
>
>Function Call:
>
>-------------------------------------------------------
>
>EXEC [PostgreSQL].dta.testuser.mssql_test   (ODBC
>Connection.Database.User.Function Name)
>
> 
>
>The response I get from Postgres is:
>
> 
>
>Error:
>
>-------------------------------------------------------
>
>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'.
>
> 
>
>Any help you can provide on this would be greatly appreciated.
>
> 
>
>Thanks in advance,
>
> 
>
>Jeff
>


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
 




 2 Posts in Topic:
Linked Server Error
jeffc@[EMAIL PROTECTED]   2008-04-16 16:09:30 
Re: Linked Server Error
z-saito@[EMAIL PROTECTED]  2008-04-17 06:58:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 16:16:48 CST 2008.