Home » Developer & Programmer » JDeveloper, Java & XML » Calling Stored Procedures Through JDBC - Behavior That Defies Logic!
Calling Stored Procedures Through JDBC - Behavior That Defies Logic! [message #91869] Wed, 04 June 2003 20:00
Mihajlo
Messages: 9
Registered: October 2002
Junior Member
OK, I have seen some weird thing before, but this tops it all. I have a very simple stored procedure that looks like this:

SELECT *
FROM CUSTOMER, TMP_TABLE
WHERE CUSTOMER.CUST_ID = TMP_TABLE.CUST_ID AND
...
CUSTOMER.SOME_INDICATOR <> 'Y';

Keep in mind that the TMP_TABLE is defined as a global temporary table. I invoke this procedure in my Java code; however even though data should be returned, the result set I get back is empty. By trial and error, I discovered that it is the condition involving SOME_INDICATOR that is causing the result set to be empty. The strange thing is that all the values of SOME_INDICATOR in the CUSTOMER table are 'N'. To show this, I executed the following query which actually returns the expected results:

SELECT *
FROM CUSTOMER, TMP_TABLE
WHERE CUSTOMER.CUST_ID = TMP_TABLE.CUST_ID AND
...
CUSTOMER.SOME_INDICATOR = 'N';

So if something is equal to 'N' would that something also not equal to 'Y'?! (BTW, SOME_INDICATOR is defined as CHAR(1) )

But here is the real kicker - if I change the GTT to a regular Oracle table, the whole problem goes away!

I also need to mention that the stored procedure from which the above queries are being invoked is being used successfully from another client application written in PowerBuilder; it is only when I try using it trough the JDBC that I have a problem. Although this would seem to indicate a problem with JDBC, I thought that, since I am using a stored procedure and not straight SQL, JDBC should not be an issue (or should it?).

Any ideas?!
Previous Topic: Stored Java function and UNC pathname
Next Topic: Can't display my recordset
Goto Forum:
  


Current Time: Thu Mar 28 18:24:26 CDT 2024