Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Return resultset from CLR


I've created a C# DLL which is called in a CLR Function in a SA12 database.

The DLL successfully returns a decimal value from this call:

SELECT sfw_GetKostverdi(param1, param2 ....paramN);

No problem, and everything checks out great.

But now I need to return a DataSet, containing one or more columns, and one or more rows.

I've tried to return a DataSet from the DLL, but I get the following error:

Table 'ExtEnvResultSet29' not found

SQLCODE=-141, ODBC 3 State="42S02"

I found an example using IDataReader, but it will not work.

Have anyone got at working example regarding this?

Or can shed any light over the issue?


Bjarne Anker

Maritech Systems AS


Former Member
Former Member replied

It looks like it works now.

I moved the "int p1" parameter to the start of the public static void function (pretty sure I've tried it before).

The stored procedure has one parameter in: "IN p1 INT"

The CLR definition has two parameters, to match the function in the DLL: (int p1, IDataReader readers[]).

When calling the procedure like this:

call GetResultSet1(2)

It returns all rows in the example-table where c1=2 (I've also modified the select-statement from the example).

I have no idea why it works, but now it does!



0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question