Quantcast
Channel: SCN: Message List - SAP SQL Anywhere
Viewing all articles
Browse latest Browse all 2182

Re: Return resultset from CLR

$
0
0

I tried the example in the reply to this post:

http://sqlanywhere-forum.sap.com/questions/11524/generating-resultset-from-clr

 

In short, I have this function in my DLL:

 

public static Dataset GetKostVerdi(int p1, string p2)

{

     DataTable dt = new DataTable("Table");

     DataSet ds = new DataSet("Result");

     decimal value1;

     decimal value2;

 

     ....some code....

    

     dt.Rows.Add(value1, value2);

     ds.Tables.Add(dt);

 

     return ds;

}

 

The stored procedure in SA12 is defined like this:

 

CREATE PROCEDURE spw_GetKostverdi( in p1 integer,in p2 varchar(8) )

result( Res1 numeric(10,3),Res2 numeric(10,3) ) dynamic result sets 1

external name 'D:\\TEST\\CLRKalkyle.dll::CLRKalkyle.CLRKalkyle.GetKostVerdi2(int,string)' language clr

 

It's important that I cas pass parameters into the DLL and receive a resultset.

 

I wasn't aware of the folder with the provided examples, and I will of course test this.


Viewing all articles
Browse latest Browse all 2182

Trending Articles



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