How do I pass a DYNAMIC RESULT SET back to Visual Basic ?

General
Enthusiast

How do I pass a DYNAMIC RESULT SET back to Visual Basic ?

Hello,

I see that a stored procedure can pass a cursor back to a calling application by using a DYNAMIC RESULT SET.  My calling app is Visual Basic, and I can not find any info on how to do this from the VB side.   An Oracle stored procedure passes back a reference to the cursor by using a stored procedure OUT parameter, and the VB code can reference it as shown below.

objExpCmd.Parameters.Add("p_cursor", OracleDbType.RefCursor, ParameterDirection.Output)

But how does a Teradata stored procedure give the name of the cursor to VB ?  The clip below (from the TD Stored Procedure manual) opens the two cursors, but I dont see any mechanism to  pass them back to the caller.   Can someone point me to any examples of how to do this?  Thanks!

CREATE PROCEDURE Sample_p (INOUT c INTEGER)

DYNAMIC RESULT SETS 2

BEGIN

DECLARE cur1 CURSOR WITH RETURN ONLY FOR

SELECT * FROM m1;

DECLARE cur2 CURSOR WITH RETURN ONLY FOR

SELECT * FROM m2 WHERE m2.a > c;

SET c = c +1;

OPEN cur1;

OPEN cur2;

END;