AsText - Mailing list pgsql-odbc

From James Slater
Subject AsText
Date
Msg-id 25211099.131451277129121404.JavaMail.root@zimbra.keynetix.com
Whole thread Raw
Responses Re: AsText  (James Slater <james.slater@keynetix.com>)
List pgsql-odbc
Hi All

Using SQL Server 2008 64bit with a linked server to the experimental 64bit postgres ODBC driver I have experienced the
followingproblem: 

If I execute the following query, which should return the WKT string of the geometry for all items in the table.

select * from OPENQUERY(<linked_server>,'
    SELECT AsText(tbl.geom)::varchar(4000) as t
    FROM <table_name> tbl
')

It returns the following Error : Cannot get the column information from OLE DB provider "MSDASQL" for linked server
"<linked_server>".

Where as if I change the query to the following :

select * from OPENQUERY(<linked_server>,'
    SELECT t FROM (
        SELECT AsText(tbl.geom)::varchar(4000) as t
        FROM <table_name> tbl
    ) tmpTable
')

The query runs no problem.

Querying out other varchar fields from the postgres table also works no problem, it just seems to be the AsText
function?

Its not really too much of a problem as there is an easy work around, but just wondering if you have any more info on
whythis was happening. 

Thanks
James



pgsql-odbc by date:

Previous
From: raiford@labware.com
Date:
Subject: Re: Can someone explain the current state of BLOB fields and Postgres ODBC?
Next
From: James Slater
Date:
Subject: Re: AsText