Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Inserting large sql of records into a array (PM's)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 26 April 2007 :  20:37:12  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I have a query that inserts 47,599 records into a array like...

username,username,username,username,etc

The problem is going thru this many records it takes the page a very long time to load. Does anyone know of a quicker way to insert the records into the array? Listed below is the current code that is being used.

strSql = "SELECT M_NAME"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_PMRECEIVE = 1"
strSql = strSql & " ORDER BY M_NAME Asc"

set rsName = my_Conn.Execute (strSql)

do while not rsName.eof    	
	arrAllNames = arrAllNames & rsName("M_NAME")
	rsName.moveNext
	if not rsName.eof then
		 arrAllNames = arrAllNames & ","
	end if
loop
rsName.close
set rsName = nothing
arrNames = split(arrAllNames, ",")
<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" />

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets

Edited by - Shaggy on 27 April 2007 04:01:20

redbrad0
Advanced Member

USA
3725 Posts

Posted - 26 April 2007 :  23:53:18  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Just to update this, I used the getrows to insert all the data into the array. I am still running test but so far everything seems to be running sooo much faster.

arrNames = rsName.GetRows

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 27 April 2007 :  04:02:01  Show Profile
That was gonna be my recommendation, but you beat me to it.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 27 April 2007 :  10:55:11  Show Profile  Send pdrg a Yahoo! Message
My 2p, without knowing the application or your needs or reasons, would be that a 50,000 element array is just one possible solution to a problem with a much better solution out there...

50,000 rows suggests a setwise operation, could it be done by the dbengine more efficiently, I wonder?

P :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07