July 15, 2020 at 3:13 pm
Hi could anyone please shed some light how this sql works. i.e. how the cursor is being used in the following:
select * from
table (ts_summary ( cursor (
select sd.USRN ,
sd.special_desig_source_ha,
sd.street_special_desig_num ,
sd.STREET_SPECIAL_DESIG_CODE,
sd.Street_Descriptor ,
sd.special_desig_description ,
sd.special_desig_location_text ,
sd.special_start_x ,
sd.special_start_y ,
sd.special_end_x ,
sd.special_end_y
from TNSG_streets_special_desig sd
where sd.STREET_SPECIAL_DESIG_CODE = 2
order by sd.usrn
July 15, 2020 at 4:09 pm
Are you sure that is SQL Server code and not Oracle or some other RDBMS? This is a SQL Server site, so you're likely to get better help somewhere else.
John
July 15, 2020 at 4:28 pm
that is Oracle SQL - Pipeline or Parallel Table Function - see https://docs.oracle.com/cd/B19306_01/appdev.102/b14289/dcitblfns.htm
and if you crosspost to other forums at least have the courtesy of posting the link to the other forum - this was also posted on stackoverflow.
July 16, 2020 at 6:30 am
p.s. SQL <> SQL so always identify which RDBMS engine you're using.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2020 at 12:46 am
Just to be sure, are you trying to convert Oracle to SQL Server?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 17, 2020 at 6:58 am
Yes I was intending to convert to sqlserver.
I managed to figure this out. Ts_summary was a custom function. All sorted.
Thanks.
July 17, 2020 at 7:22 am
for other readers benefit it may be worthwhile posting the T-SQL version of the above code.
I'm sure many will have some difficulties with similar constructs
July 17, 2020 at 3:01 pm
Yes I was intending to convert to sqlserver.
I managed to figure this out. Ts_summary was a custom function. All sorted.
Thanks.
Awesome... can you post the code so we can do a comparison and maybe learn something new? Thanks.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply