Skip to content
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

feat. req. odbc multicursors opened for sub-iteration #131

Open
mckaygerhard opened this issue Jun 27, 2017 · 16 comments
Open

feat. req. odbc multicursors opened for sub-iteration #131

mckaygerhard opened this issue Jun 27, 2017 · 16 comments

Comments

@mckaygerhard
Copy link

i found a old (or new depends if newer driver works for me) bug..

odbc does not permit to me made subquerys... i mean..
a) made a quiery with current conection
b) iterate on results
c) try another query with current conection but not finish to iterate
d) get a error from low level (i mean from odbc modulo, that are freetds)

the programing languajes are gambas and visual basic 6 same error on both, from php too but in php i not tested deeply, shoul that fill in new issue?

@freddy77
Copy link
Contributor

freddy77 commented Jul 5, 2017

This is a protocol limitation. Workarounds are cursors and MARS. In ODBC the terminology is multiple active statements.

@freddy77 freddy77 closed this as completed Jul 5, 2017
@mckaygerhard
Copy link
Author

hi, freddy i think you dont understand the proble, i assume that the odbc implementation offers the cursor right? and the querys itarate over the cursor! so i was thinking that the code implementation in gabmas or/and visualbasic are using always the cursor!

@freddy77
Copy link
Contributor

freddy77 commented Jul 6, 2017

Is not automatic, depends on the type of cursor they use. The default type are not enough. So it implementation dependent. You can enable MARS (on the connection) and use ODBC.

@mckaygerhard
Copy link
Author

hi @freddy77, remenber that i dont taking about the Mocosoft SQLserver, i'm using sybase.. does handle the ODBC freetds those types of cursos respect sybase feaured? does sybase have the usage of that "mars" feature? i guess now i made the right questions and depends of the response this can be a bug or not

@freddy77
Copy link
Contributor

Yes, you are right, cursors are not supported for Sybase.

@freddy77 freddy77 reopened this Jul 17, 2017
@mckaygerhard
Copy link
Author

umm its hard to believe! maybe we are poor informated about it! must be a workaround or something that we cannot see it!

@mckaygerhard
Copy link
Author

umm seems here http://sqlanywhere-forum.sap.com/questions/30539/does-sybase-support-something-like-mars-cursors i gues that its not supported but i ask directly now to a trith partner of sybase.. i'll waith the answerd and pot feedback here..

@mckaygerhard
Copy link
Author

so based on http://sqlanywhere-forum.sap.com/questions/30539/does-sybase-support-something-like-mars-cursors i'll close that.. i change the issue title to point clarify

@mckaygerhard
Copy link
Author

i reopened due that:

Currently, the only way to enable MAS in FreeTDS is to use a dynamic cursor.

what about it?

@mckaygerhard mckaygerhard reopened this Jul 19, 2017
@mckaygerhard mckaygerhard changed the title odbc freetds could not permit subquerys? odbc freetds could not permit multicursors opened for sub-iteration? Jul 19, 2017
@mckaygerhard
Copy link
Author

mckaygerhard commented Jul 19, 2017

tested with odbc provided by easysoft and java also .net, here a code in java works, but with others using freetds dont:

easysoft said that must be enabled dynamic cursors, how?

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import sybase.jdbc4.sqlanywhere.*;

public class marsOdbc {

	public static void main(String[] args) throws Exception   {
		// TODO Auto-generated method stu
		String query = "select * from EXAMPLE0001";
		Connection conex = DriverManager.getConnection("jdbc:sqlanywhere:uid=DBA;pwd=sql;dsn=hablador");
		Statement stmt = conex.createStatement();
		Statement stmt2 = conex.createStatement();
		Statement stmt3 = conex.createStatement();
		ResultSet rs=stmt.executeQuery(query);
		ResultSet rs2;
		while (rs.next()){
		System.out.println(rs.getInt("a") + "   " + rs.getString("b"));	
		stmt2.executeUpdate("update EXAMPLE0001 set b='Cam.Nuevo' where a="+rs.getInt("a") );
		rs2=stmt3.executeQuery("select * from tc_codmsc");
		    while(rs2.next()) {
		    	System.out.println(rs.getString(1));			    	
		    }
		}
		rs=stmt.executeQuery(query);
		while (rs.next()){
			System.out.println(rs.getInt("a") + "   " + rs.getString("b"));	
			
			}
		conex.close();

	}

}

@freddy77
Copy link
Contributor

freddy77 commented Aug 1, 2017

Yes, currently cursors are not supported under Sybase (protocol 5.0). The only workaround is use multiple connections.

@mckaygerhard
Copy link
Author

mckaygerhard commented Aug 1, 2017

hi @freddy77, i think its supported, in java with same connection (really hate java) i can retrieve data.. but in linux using freetds cannot do that! i think its a freetds limitation! a partner in my job can doit with same code in java.. but in freetds in same guindows OS cannot! so i think could check that a little...

also the private env that i promised i'll send to you later.. due i must free an slot in the virtual station

@freddy77
Copy link
Contributor

freddy77 commented Aug 3, 2017

What I was trying to say is that we (FreeTDS) do not support cursors using Sybase server. Yes, Sybase supports them.

@mckaygerhard
Copy link
Author

arrgggg, its so hard to implementing at short time right? i must let open this issue or close it? (based on your response), if let open i must change tittle to "feature request"?

@freddy77
Copy link
Contributor

freddy77 commented Aug 4, 2017

Yes, should go in the feature request. My big item todo list is:

  • finish Sybase 16 with new calls;
  • release;
  • encrypted fields.

@mckaygerhard
Copy link
Author

i have sybase 16 instalation (16 only develper license, 12 complete license) for tests..

for access to environment sorry for late, i'll still busy but next week i have somenthing

now i changed title, and please reamin low dependency (for my embebed devices with older linuxes)

@mckaygerhard mckaygerhard changed the title odbc freetds could not permit multicursors opened for sub-iteration? feat. req. odbc multicursors opened for sub-iteration Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants