November 11, 2006 at 2:30 am
We need port an Oracle query like so:
select cursor(select * from foo), cursor(select * from bar) from dual
Can anyone help us write the equivalent query for SQL Server?
Thanks in advance.
Avinash Chugh.
November 11, 2006 at 5:21 am
Never seen that anywhere. Can you post some sample data and the required output from that sample data?
November 11, 2006 at 11:51 pm
check out the sql-block just before example 2 over here:
http://www.oreillynet.com/pub/a/network/2003/01/22/feuerstein.html
and a better description of the layout of the data here:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:7866466844558
November 14, 2006 at 7:07 am
Sorry for the delay. I had forgotten about your question.
There is no equivalent to tht in sql server.
You have to do an inner join on the 2 tables to get a resultset like this one. You may also use a derived table if you need to :
Select * from a inner join (Select B.key, b.Cola from b) as dtB ON a.key = b.key
November 14, 2006 at 8:19 pm
Thanks, we were using it to generate xml using a combination of tables in the database. Looks like we can avoid inline cursors altogether using the FOR XML EXPLICIT syntax.
November 15, 2006 at 6:35 am
So that thread is closed for you??
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply