This is a migrated thread and some comments may be shown as answers.

Data Access with oracle function

1 Answer 94 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ruby
Top achievements
Rank 1
Ruby asked on 19 May 2014, 09:35 PM
I have to use oracle function to populate data in my radgrid.
My data access function is like code below , it is giving output as cursor

Public Function ACTIVE_PROMOS() As Integer Implements IEntitiesModelUnitOfWork.ACTIVE_PROMOS
Dim queryResult As Integer = Me.ExecuteNonQuery("SELECT ""PLUTO"".""INV_ATH"".""ACTIVE_PROMOS""() FROM dual", CommandType.Text)
Return queryResult
End Function

I have use this function as a datasource of my radgrid as attached. Please let me know how to do that
Protected Sub rgCurrentPromo_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgCurrentPromo.NeedDataSource
       Using dbContext As New AthenaModel.EntitiesModel()
           Dim query As DataTable()
           dbContext.ACTIVE_PROMOS()
           rgCurrentPromo.DataSource = query
           rgCurrentPromo.DataBind()
       End Using
   End Sub



1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 21 May 2014, 02:50 PM
Hello Ruby,

Oracle functions returning cursors as output are not supported. You could achieve similar functionality using stored procedures that have cursor as an out parameter. You could learn more about this approach from this documentation article.
Once you have created stored procedures as described in the above documentation article you could use the Domain Method Editor. It should automatically recognize the output cursor parameter scenario and correctly create a domain method.
Generally you could read more about options available in the Domain Model Editor in this documentation article, but I would like to point your attention to either the Complex Type setting or the Persistent Type setting which might be more suitable for your implementation scenario.
Once the stored procedure are mapped and invoked as described above, they should return a collection which can later be assigned to be a DataSource.

Should you have any more question or need further assistance please let us know.

Regards,
Boyan
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Databases and Data Types
Asked by
Ruby
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or