Bug 47357 - No Results Returned When Selecting From Temp DB Table
Summary: No Results Returned When Selecting From Temp DB Table
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.0 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-24 11:01 EST by John Duffy CLA
Modified: 2003-11-25 12:10 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Duffy CLA 2003-11-24 11:01:35 EST
Hi,

I have the following java program calling a test stored procedure in Sybase 
ASE 12.

import java.sql.*;
public class read_temp_table {
       public static void main(String[] args)throws Exception {
		
		int legal_entity_id;
		float base_notional_amount;
	
		Class.forName("com.sybase.jdbc2.jdbc.SybDriver");

		Connection con = DriverManager.getConnection
		
	("jdbc:sybase:Tds:hpsybd:5191/dssol01","cbgsdujo","dujo1234");

		CallableStatement stmt = con.prepareCall
			("{?= call dbo.USER_pls_read_temp_table}");

		boolean results = stmt.execute();

			if (results) {
				ResultSet rs = stmt.getResultSet();
					do {
				
					rs.next();
					legal_entity_id = rs.getInt(1);
					base_notional_amount = rs.getFloat(2);
				    System.out.println (legal_entity_id  + ' ' 
+ base_notional_amount);
				  
					} while (rs.next());
				}
		stmt.close();
		con.close();
	}	
}

If the procedure USER_pls_read_temp_table is defined thus 

BEGIN

SELECT a.legal_entity_id,
       a.base_notional_amount
  FROM USER_pls_transaction a
 ORDER BY a.legal_entity_id

END

everything is fine. If I define it as below, using a temp table the declared 
boolean results getting the value of the CallableStatement method returns 
false. Both versions work when called directly through the RapidSQL ISQL 
environment.

BEGIN

CREATE TABLE #filtered_deals (legal_entity_id int null,
                              base_notional_amount decimal(25,2) null)
                              
 INSERT INTO #filtered_deals
  SELECT a.legal_entity_id,
         a.base_notional_amount
  FROM USER_pls_transaction a
  ORDER BY a.legal_entity_id

SELECT legal_entity_id, base_notional_amount 
FROM #filtered_deals


END

Please help!

TIA,

John Duffy
Comment 1 Philipe Mulet CLA 2003-11-24 11:38:47 EST
This is a defect in SQL support, nothing to do with JDT. Please open defect 
against SQL support vendor.
Comment 2 John Duffy CLA 2003-11-25 09:40:30 EST
Phillippe,

Are you suggesting that I log this as a bug against Sybase?

Regards,

John
Comment 3 Philipe Mulet CLA 2003-11-25 12:10:45 EST
Against whoever provides the SQL support to you, this has nothing to do with 
JDT Core, and Eclipse akaik.