cancel
Showing results for 
Search instead for 
Did you mean: 

Query returns 0 rows java isql

Former Member
0 Kudos

Hi, I am trying to troubleshoot a colleague's strange issue with java isql and ASE15.5. Periodically, any query or stored procedure (like sp_who) returns 0 rows. Simple select queries from system or user tables, there is no issue with the queries. I can run the same queries in DOS isql and results are returned. Connection to ASE is established, so I have no idea what's going on. Playing around with it, I switched the option "Automatically refetch results" off and on under tools->options and the queries start returning results. However, when I close and restart isql, the same issues happens and I have to switch that option off and on (or leave it off) again. I have no idea why.

Anyone have any ideas what's going on?

thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

ambati
Discoverer
0 Kudos

Hi David.

On the offset, jisql is no longer a supported application. If you check the utils under jConnect 7, you would find the jisql app to be missing.

Anyway, on jisql 2.0.0523 I do not see this issue.

What version of jisql are you using? what version jConnect are you using? Both these version have a say in this.

Having said that, if I may theorize the scenario, the issue you are seeing *could be* due to the fact that when you have 'Automatically refetch results' turned on (this was the original default value - this has been changed in later versions e.g, 2.0.0523), the result set tab automatically regenerates the result set anytime after an  INSERT, UPDATE, or DELETE statement is executed. When you are running a procedure like sp_who, which may have such a DML operation interfering with a SELECT in the procedure, this becomes evident. In older versions, you might even see some inappropriate error messages as well.

For example, if you execute a statement batch like
select * from T1;
(execute)
delete from T1;
(execte)

you will have the first result set updating to 0 rows

In some older versions, there was a bug which caused the following statements to return an error on the select result set
select * from T1;
(execute)
delete from T1; DROP TABLE T1;
(execte)

When you turned off 'Automatically refetch results', rightfully, you were not seeing 0-row result sets.

For the same reason, you do not see the behaviour you mentioned, when you execute a standalone SELECT statement.

Now coming to the second portion of your question...

When you change an option this way, you can save a.k.a lock the preferences by writing them to the username.prp file.

However, I don't think jisql is managing the locking of all the  preference, and hence when you restart the app, you are back to the default value.

Can you check to see what version of jConnect/jisql you are using?