Database query hangs up, why?
Posted in Help the coder! on Aug 20, 2009 at 12:13 IST (11 months ago). Subscribe to this post
Email
Showing comments 1 to 5 of total 5 on page 1 of 1
Post replyShowing comments 1 to 5 of total 5 on page 1 of 1
« Previous1Next »
mathewge...Rank: 107
Hello all,
I have a program that reads and uploads RTF files into a database. This program stores all the styles of the file to html format. ie, Its is like an rtf to html converter. What happens is that, when i convert large files (size: 2Mb or high), the query hangs up, ie, the program has to wait endlessly for that query to complete.
Any idea what is happening?
I have a program that reads and uploads RTF files into a database. This program stores all the styles of the file to html format. ie, Its is like an rtf to html converter. What happens is that, when i convert large files (size: 2Mb or high), the query hangs up, ie, the program has to wait endlessly for that query to complete.
Any idea what is happening?
Posted by mathewgeorge on Thursday, August 20, 2009, 12:13 pm
xtrmprgrmrRank: 7
Might be a connection or DB limitation. Why don't you do an insert first and then followed by concatenated updates to the same field?
Posted by xtrmprgrmr on Thursday, August 20, 2009, 2:07 pm
mathewge...Rank: 107
how do i do that? should i split the larger files into smaller chunks and insert them?
Posted by mathewgeorge on Thursday, August 20, 2009, 3:43 pm
rad4dieRank: 119
something like,
recordId = sql( "insert into tablename (fieldname) values( '' )" );
while( remaining != empty ) {
chunk = empty;
if( length( remaining ) > chunk_size ) {
chunk = first( remaining, chunk_size );
remaining = last( remaining, length( remaining ) - chunk_size );
}
else {
chunk = remaining;
remaining = empty;
}
sql( "update tablename set fieldname = '" + escape( chunk ) + "' where id = '" + recordId + "'" );
}
Thankful users: mathewgeorge
Posted by rad4die on Friday, August 21, 2009, 9:07 am
Pages: « Previous1Next »