Jason 'Bug' Fenter [TeamSybase]
2009-06-18 18:43:26 UTC
I have a table-valued function in MS SQL Server 2000. How do I implement
that in SQLAnywhere 10?
The underlying data is a hierarchy of areas with an "id" column and a
"parentid" column. The user function gives all children of a given ID,
regardless of the nesting level. So given that "Area A" has child "Area
B" which itself has child "Area C", fGetAreas("Area A") would return
both "Area B" and "Area C". And in MSSQL, the results look like a table.
As in:
SELECT SubArea
FROM fGetAreas("Area A")
How do I do something like that in SQLAnywhere 10?
that in SQLAnywhere 10?
The underlying data is a hierarchy of areas with an "id" column and a
"parentid" column. The user function gives all children of a given ID,
regardless of the nesting level. So given that "Area A" has child "Area
B" which itself has child "Area C", fGetAreas("Area A") would return
both "Area B" and "Area C". And in MSSQL, the results look like a table.
As in:
SELECT SubArea
FROM fGetAreas("Area A")
How do I do something like that in SQLAnywhere 10?