Oracle: Select From Record Datatype

后端 未结 6 1040

I have a function that returns a record datatype (2 fields: ID and Name). How can I get at the data from a select statement?

Specifically, I am trying using an Oracl

6条回答
  •  长情又很酷
    2020-12-10 20:04

    I think this what you are looking for; to get the values out in a select statement:

    select result.id as id, result.name
      from ( select function() as result from dual);
    

    Because your function returns a record an not a native type you can't use the standard methods. The if you want to get the actual record as an object into C# then you have do some reading on user defined types in the ODP .net documentation.

    You could also wrap the function in another function that returns a ref cursor and that is used in C# in a more standard fashion.

提交回复
热议问题