Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How does left join work in Oracle 11g?

910451Jan 11 2012 — edited Jan 13 2012
Hi,

I have a problem with Oracle 11g and .Net 3.5 Framework ( i tested it in framework 4 and it crashs too) when I run stored procedure that contains some left join and query result is returned in a sys_refcursor. I think I've detected the problem after many tests, but I `m not sure to be right. I need to confirm this and obtain a solution.

.Net crashes when oracle returns a cursor and tries to cast fields to their specific type. Only happens when returned fields are number type, String/Varchar type doesn't crash. I think Oracle 11g doesn´t initialize left join fields if there are no data. So when .Net try to cast, knocks down because fields don`t have an expected value like null. That is, field not null, then it must be a number, so if oracle returns something distinct of null, fails.

It's funny because I try this with left join number fields

NVL(columnname, NULL) alias

And .Net worked. But isn´t the solution.

I think I can force Oracle to return always null values. Is It configurable? I don´t want to do a cast in stored procedure query (this is only solution i found in other forums). Also I can´t change .Net System.Data.OracleClient provider to Oracle.DataAccess.Client because Oracle dbtypes doesn´t implement IConvertible interface and when I cast a parameter value it fails...

Any idea??

Thanks!!


Sorry for my English.

Edited by: 907448 on 11-ene-2012 11:41

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 10 2012
Added on Jan 11 2012
16 comments
1,499 views