Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Trying to use geography data type in Reporting Services dataset query

$
0
0

I have a select that picks up latitude and longitude as well as a couple of other fields from a IBM iSeries db2 database...

select t1.sosono as soso,
cast( t2.lxlon as varchar(20)) as long,
cast( t2.lxlat as varchar(20)) as lattit
from library1.table1 t1 join library2.table2 t2 on t1.loc = t2.loc
where t1.code='*CL' and t1.rtdt = '0001-01-01'

...and I would like to include a generated field of type geography from the long and lattit fields, imagining it to look something like...

select t1.sosono as soso,
cast( t2.lxlon as varchar(20)) as long,
cast( t2.lxlat as varchar(20)) as lattit,

cast (Point(t2.lxlat, t2.lxlon, 4326) as geography) as position

from library1.table1 t1 join library2.table2 t2 on t1.loc = t2.loc
where t1.code='*CL' and t1.rtdt = '0001-01-01'

...but I don't seem to be able to get it right.

By way of a trial I used ...

SELECT geography::Point(-77.010996, 38.890358, 4326)

...in a query on MS SQL Server management studio and it returned a location...

0xE6100000010CC2189128B44053C0B1DD3D40F7714340

...no problem but when I tried using the same query in a dataset in reporting services and try to save the query it throws the alert starting...

"Could not create a list of fields for the query...Cause:  An attempt was made to open cursor C000001 which refered to prepared statement S00000.  Statement S000001 has one of the following conditions:--the statement has never been prepared.--the statement was prepared in another program  or another call of this program...."

  Could someone kindly show how to use the geography data type and spatial functions in Reporting Services?

Thanks much for any help, Roscoe


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>