Oracle and Pipelined function

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jpt
Posts: 3
Joined: Mon 07 Nov 2011 08:50

Oracle and Pipelined function

Post by jpt » Mon 07 Nov 2011 09:16

Hello

I have a package, with a pipelined function.

Code: Select all

PACKAGE "PKG_TEST"
AS
	TYPE RTest is RECORD ( dummyText VARCHAR2(100) );
	 TYPE TableRTest is table of RTest;
	FUNCTION GetSelected ( USERNAME VARCHAR2 ) RETURN TableRTest PIPELINED;
END PKG_SELECTED;
and, in sql environnement, i can use it :

Code: Select all

Select * from table(PKG_TEST.GetSelected('jack'))
How can i use it with linq ?
I try many possibility, and i always have errors.
What is The method to use ?

Thanks
Jean-Philippe

jpt
Posts: 3
Joined: Mon 07 Nov 2011 08:50

Post by jpt » Mon 07 Nov 2011 15:34

When i use entity Developper, in the database explorer, i see return type is "Table"
is it normal ?

jpt
Posts: 3
Joined: Mon 07 Nov 2011 08:50

Post by jpt » Wed 09 Nov 2011 07:56

Is it possible or impossible ?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 09 Nov 2011 18:04

Sorry for the delay.

Could you please specify the ORM solution you are working with? For example, to call table-valued functions via LinqConnect, you can perform the following:
- Add the function to the model (for example, drag and drop the package from the Database Explorer tool window to the model canvas).
- At this moment, you will be prompted to get the metadata of the function's result set. If you agree to do this, a complex type representing the RTest record type will be created. Besides that, Entity Developer will create a method wrapping calls to the procedure.
- To execute the function, you can just call this wrapper method from an instance of DataContext, e.g.,

Code: Select all

MyDataContext context = new MyDataContext() { Log = Console.Out };
var list = context.GetSelected("John Smith").ToList();
If you encounter any problems with this, could you please describe them in more details?

Post Reply