• Post Reply Bookmark Topic Watch Topic
  • New Topic

Restricting the rows fetched  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
I m using JDBC to connect to Sybase Adaptive IQ 12.4.3 server.I am trying to limit the size of rows fetched from a table which contains 12 lac records.After selecting the records I am writing them to a flat file using Export in sybase.
But my set rowcount statement is not showing any effect and whole of my 12 lac records are written into the file.The code i m using is as below:
boolean b=stmt.execute("select customer_key,month_key,service_key,status_key,comb
ined_revenue into #temporary from telco_facts ");
stmt.execute("set rowcount 100");
stmt.execute("SET TEMPORARY OPTION Temp_Extract_Name1='f:\\topRec.txt'");
stmt.execute("select * from telco_facts order by service_key");
If instead of exporting the data into flat file ,I select it into a resultset
set row count works.I m using JConnect 5.5 JDBC driver.
I also tried stmt.setFetchSize(100) but that also is not working.
Please suggest me how should I resolve this problem.
Is there any other way of restricting the no of rows selected at the server itself.
Thanks in advance.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!