[unixODBC-support] Problem in using cursor to fetch millionsof rows

Jerry Lam jlam at sandvine.com
Wed Apr 6 18:37:55 BST 2005


Hi,

Thanks for the reply. I checked back the release date of the tclodbc, it was dated as 2000-12-10 14:00 in sourceforge. Then I checked the version of unixodbc that I'm using is unixODBC-2.2.7_005. The first version of unixODBC is dated on 1999, do you think that explains why tclodbc doesn't allow to cursor through row by row because maybe the early version of unixODBC doesn't have that feature yet?

Thanks,

Jerry

-----Original Message-----
From: unixodbc-support-bounces at easysoft.com
[mailto:unixodbc-support-bounces at easysoft.com]On Behalf Of Nick Gorham
Sent: Wednesday, April 06, 2005 1:13 PM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] Problem in using cursor to fetch
millionsof rows


Jerry Lam wrote:

>Hi,
>
>I would like to know how can I use the cursor such that it returns me 1 row at a time? My problem is that I'm using tclodbc which is an odbc layer on top of tcl and it makes call to unixodbc for SQL execution. 
>My table has some millions of rows, when I try the following, (sorry it is in tcl but it is very easy to follow) it will consume all the memory in my machine and force it to return error. How can I effectively use cursor to just ask to return 1 row at a time?
>
>Thank you very much,
>
>Jerry
>
>% package require tclodbc
>2.3.1
>% database db "DRIVER=PostgreSQL;Servername=localhost;UID=xxx,PWD=xxx;Database=bar"
>db
>%  db set autocommit 0
>OK
>% db statement stmt "select * from foo"
>stmt
>% stmt set maxlength 200
>OK
>% stmt set maxrows 1
>OK
>% stmt execute
>
>  
>
Hi,

I would guess its down to TCL, all unixODBC will do is ask the driver 
what the app wants, it certainly won't store rows in memory. I would 
expect thats being done in the tclodbc layer.

-- 
Nick Gorham
Easysoft Limited
_______________________________________________
unixODBC-support mailing list
unixODBC-support at easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-support




More information about the unixODBC-support mailing list