AsText

AsText

am 21.06.2010 16:05:21 von James Slater

Hi All

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

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

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

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

Where as if I change the query to the following :

select * from OPENQUERY(,'
SELECT t FROM (
SELECT AsText(tbl.geom)::varchar(4000) as t
FROM 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 why this was happening.

Thanks
James



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

Re: AsText

am 21.06.2010 18:46:06 von James Slater

To add a bit more info, same problem occurs when selecting other postgis functions, for example ST_Length

----- Original Message -----
From: "James Slater"
To: pgsql-odbc@postgresql.org
Sent: Monday, 21 June, 2010 15:05:21 GMT +00:00 GMT Britain, Ireland, Portugal
Subject: [ODBC] AsText

Hi All

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

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

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

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

Where as if I change the query to the following :

select * from OPENQUERY(,'
SELECT t FROM (
SELECT AsText(tbl.geom)::varchar(4000) as t
FROM 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 why this was happening.

Thanks
James



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



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