Click here to Skip to main content
15,887,083 members
Home / Discussions / Database
   

Database

 
GeneralRe: list all sql server running on a network Pin
totu9-Nov-05 0:58
totu9-Nov-05 0:58 
GeneralRe: list all sql server running on a network Pin
Gavin Taylor9-Nov-05 2:06
professionalGavin Taylor9-Nov-05 2:06 
AnswerRe: list all sql server running on a network Pin
abhinish11-Nov-05 21:23
abhinish11-Nov-05 21:23 
Questionsql back up advise Pin
Goodway8-Nov-05 4:36
Goodway8-Nov-05 4:36 
AnswerRe: sql back up advise Pin
Jon Sagara8-Nov-05 4:45
Jon Sagara8-Nov-05 4:45 
AnswerRe: sql back up advise Pin
Scott Serl9-Nov-05 6:14
Scott Serl9-Nov-05 6:14 
QuestionSQL & NaN's Pin
Gilad Kapelushnik8-Nov-05 2:52
Gilad Kapelushnik8-Nov-05 2:52 
QuestionReading records in Chunk Urgent Pin
behi20007-Nov-05 15:52
behi20007-Nov-05 15:52 
I have two tables that I am trying to read using OleDB (tableA and tableB) the primary keys for tableA are: col1, col2, col3. tableB has col1, col2, col3, col4, and col5 where col1, col2, and col3 are foreign keys. Because of large number I instances I cannot read all the instances at once. The reason is that I get cache Exception error and Db2 admin does not want to increase the size of db2 cache. I used two nested loops in order to create and execute following sql statements

String SQLSt = "SELECT tableA.col2, tableA.col3, tableA.col4, tableB.col2, tableB.col3, tableB.col4, tableB.col5, TableB.Col6
From tableA inner join tableB
On (tableA.col1 = tableB.col1 and tableA.col2 = tableB.col2 and tableA.col3=tableB.col3 AND tableA.col4 = tableB.col4) where tableA.col1 = 55 order by tableA.col2, tableA.col3, tableA.col4, tableb.col5, TableB.col6 FETCH FIRST " + 2000 + " ROW ONLY";

I use the above statement outside of the loop to read the first 2000 record.

I used following statement in a outer loop to read the following records in chunk of 2000.

SQlSt = "SELECT tableA.col2, tableA.col3, tableA.col4, tableB.col2, tableB.col3, tableB.col4, tableB.col5, TableB.col6
From tableA inner Join tableB
On (tableA.col1 = tableB.col1 and tableA.col2 = tableb.col2 and tableA.col3=tableB.col3 AND tableA.col4 = tableB.col4) where tableA.col1 = 55 and tableA.col2 >= previous_value and tableA.col3 >= previous_value and tableA.col4 >= previous_value and tableb.col5 = previous_value And TableB.col6 >= Previous_value
order by tableA.col2, tableA.col3, tableA.col4, tableB.col5, TableB.col6 FETCH FIRST " + 2000 + " ROW ONLY”;

The inner loop would read one record at a time and store the information in a memory cache.

The number of records that is read is much less than actual records for instances where col1 = 55. That is there are 45000 records and I read only 29000. If I do FECH FIRST 100 row only


Then I get about 20000 records.

1. Is there a way that I can specify in the sql statement to read record I to record I+2000?

I would appreciate any solution to this problem.

Thanks

The Ole command is:

OleDbCommand cmdIndx = new OleDbCommand();
cmdIndx.Connection = new OleDbConnection( ConfigurationSettings.AppSettings["DBConn"]);
OleDbDataReader rdrIndx;
cmdIndx.CommandText = strSQL;
cmdIndx.Connection.Open();
rdrIndx = cmdIndx.ExecuteReader();
rdrIndx.Read()

QuestionA couple of beginner questions Pin
matthias s.7-Nov-05 3:04
matthias s.7-Nov-05 3:04 
AnswerRe: A couple of beginner questions Pin
Daniel Santillanes8-Nov-05 13:16
professionalDaniel Santillanes8-Nov-05 13:16 
Questionhow can i connect MsAccess Pin
sheerprogrammer6-Nov-05 21:17
sheerprogrammer6-Nov-05 21:17 
Questionfull-text search help Pin
rockmouse6-Nov-05 17:27
rockmouse6-Nov-05 17:27 
QuestionHow to transform 3 Tables?? Pin
tbrake6-Nov-05 0:03
tbrake6-Nov-05 0:03 
QuestionTrain free @Microsoft Pin
vikas amin4-Nov-05 23:35
vikas amin4-Nov-05 23:35 
AnswerGet a life Pin
Rob Graham5-Nov-05 15:38
Rob Graham5-Nov-05 15:38 
GeneralRe: Get a life Pin
toxcct6-Nov-05 0:36
toxcct6-Nov-05 0:36 
Questionmetadata Pin
kittubond_0094-Nov-05 21:25
kittubond_0094-Nov-05 21:25 
AnswerRe: metadata Pin
André Ziegler4-Nov-05 23:53
André Ziegler4-Nov-05 23:53 
GeneralRe: metadata Pin
kittubond_0095-Nov-05 15:33
kittubond_0095-Nov-05 15:33 
QuestionSql Connection Pin
NormBohana4-Nov-05 14:04
NormBohana4-Nov-05 14:04 
AnswerRe: Sql Connection Pin
Rob Graham4-Nov-05 14:56
Rob Graham4-Nov-05 14:56 
GeneralRe: Sql Connection Pin
NormBohana4-Nov-05 15:03
NormBohana4-Nov-05 15:03 
Questionaccess to MSsql pubs data from vc6.0 Pin
markoot4-Nov-05 8:31
markoot4-Nov-05 8:31 
AnswerRe: access to MSsql pubs data from vc6.0 Pin
markoot4-Nov-05 10:55
markoot4-Nov-05 10:55 
Questionsp procedure Help!!! Pin
Petdav4-Nov-05 4:24
Petdav4-Nov-05 4:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.