-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table of CustomType out parameter in store procedure #381
Comments
Table 3-33 in the ODP.NET dev guide can be helpful to make sure you've set up your output parameter correctly. I believe you want to use |
Thank you for you response @alexkeh
And my procedure calling snippet is
Am getting below errors message
And i got some stack trace of error is
|
That's an unusual error. There seems to be some incompatibility. Which DB version are you using? Which ODP.NET version are you using? Please run the following command from SQL Plus or another DB command line and share the results: |
@alexkeh Here is my .csproj file
My OracleDB Version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 |
@Anbuselvam2001 Ah, the DB version is the source of your issue. Between DB 11.2 and 12.1, UDT metadata definitions made a major change such that 11.2 UDT DB APIs were no longer backward compatible. The GET_TYPE_SHAPE error you see is indicative of one of those API differences between 11.2 and 12.1+. When ODP.NET 21c was released, DB 11.2 had basically reached the end of Extended Support. Thus, ODP.NET 21c only supports DB 12.1 and higher. If you upgrade your DB, it's likely you'll then be able to get your code working. |
@alexkeh Thanks for your Response. Is there any alternative way to achieve the same instead of DB upgrade. Could you guide me.. |
@Anbuselvam2001 None that I can think of using UDTs in ODP.NET. You could have PL/SQL operate on the UDT and then pass data to ODP.NET via an associative array or scalar types. You could convert the UDT into XML or JSON for ODP.NET to then use. These solutions require a non-trivial amount of work, however. |
@alexkeh Thanks for your suggestion. |
@alexkeh I successfully handled the TYPE scenario, but currently facing issues while trying to access the table of record in package level
My Mapping class
My C# code is
Below Error Getting - Stack trace -
|
@Anbuselvam2001 ODP.NET doesn't support PL/SQL record types yet. There's an existing request to support this capability (#275) that can be upvoted. |
I have custom type in oracle db schema level
create or replace TYPE EMPLOYEE_TYPE AS OBJECT
(
name VARCHAR2(4),
salary NUMBER(6)
);
and also Table type
create or replace TYPE EMPLOYEE_TABLE
AS TABLE OF EMPLOYEE_TYPE ;
My Store procedure pretty simple
create or replace PROCEDURE get_employees(employees OUT EMPLOYEE_TABLE) AS
BEGIN
-- Populate the EMPLOYEE_TABLE with sample data
employees := EMPLOYEE_TABLE(
EMPLOYEE_TYPE ('John', 50000),
EMPLOYEE_TYPE('JACK', 60000),
EMPLOYEE_TYPE('Bob', 55000)
);
END get_employees;
Can anyone please guide me to achieve in C#?
am tried the below snippet.. getting so errors only
The text was updated successfully, but these errors were encountered: