Does psqlodbc support declare/fetch in Un ux?

Поиск
Список
Период
Сортировка
От 王宝兵
Тема Does psqlodbc support declare/fetch in Un ux?
Дата
Msg-id 44BDD4DA.00002E.05831@bj163app24.163.com
обсуждение исходный текст
Ответы Re: Does psqlodbc support declare/fetch in Un ux?  (Ludek Finstrle <luf@pzkagis.cz>)
Список pgsql-odbc
I am testing psqlodbc in our school.I wrote the following code:
 
...
 rtcode=SQLExecDirect(hstmt,"select * from pg_largeobject",SQL_NTS);
 if((rtcode!=SQL_SUCCESS) && (rtcode!=SQL_SUCCESS_WITH_INFO)){
  printf("SQLExecDirect Failed!\n");
  SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
  SQLFreeHandle(SQL_HANDLE_DBC,hdbc);
  SQLFreeHandle(SQL_HANDLE_ENV,env);
  exit(1);
 }
 printf("|loid\t|pageno\t|data\t|\n");
 for(i=0;i<100;i++){
  SQLFetch(hstmt);
  printf("|%d\t|%d\t|%s\t|\n",loid,pageno,buffer);
 }
...
 
There are 1532240 tuples in pg_largeobject, and their size is about 3GB. But where I run this code, the client's main memory is exhausted. It seems that the client try to get all the tuples before it fetches the first 100.
 
I think the client should get a small part first. If it need more tuples, it get anothor part and discard the first part. When I test psqlodbc in Windows, it seems to work well.
 
What's wrong? How can I fixed it?
 
Any reply will be appreciated!
 
Looking forward to your help!
 
 







想 要 体 验 一 下 超 大 超 快 的 免 费 邮 箱 吗 ?
网 易 3G 免 费 邮 ,抢 注 再 得 280 兆 大 容 量 网 盘 ,快 来 体 验 邮 箱 极 速 之 旅

В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Kiran Kantheti"
Дата:
Сообщение: postgre connection via odbc
Следующее
От:
Дата:
Сообщение: [ psqlodbc-Bugs-1000687 ] Problem with WHERE and upercase character