Alastair,

Cursors are slow. I think I would do a temp table.


SET ERROR MESSAGE 2038 OFF
DROP TABLE tLong_Comments
SET ERROR MESSAGE 2038 ON
CREATE TEMPORARY TABLE `tLong_Comments` +
(`Long_Comments` NOTE) – this may need to change


INSERT INTO tLongComments +
(Long_Comments) +
SELECT DISTINCT tLongComments +
FROM All_Comments +
WHERE Long_Comments NOT CONTAINS 'G:\'


EDIT USING yourformname


Make a new form with a ListView based on tLongComments.
Place your orderby in the ListView.


Jan

 


-----Original Message-----
From: "Alastair Burr" <[email protected]>
To: [email protected] (RBASE-L Mailing List)
Date: Mon, 21 Feb 2011 18:12:22 -0000
Subject: [RBASE-L] - v9.1 on W9/64 - List Box query


I have a (rarely used) form that is a Variable User List List Box with two 
buttons that now takes approaching 5 minutes to prepare the data when v7.6 
took only a few moments.
 
This is the relevant code that prepares the list:
 
DECLARE C1 CURSOR FOR SELECT DISTINCT Long_Comments +
  FROM All_Comments +
  WHERE Long_Comments NOT CONTAINS 'G:\' +
  ORDER BY Long_Comments ASC
OPEN C1
FETCH C1 INTO vAddList
WHILE SQLCODE = 0 THEN
  PROPERTY IDLB_CommentsMenu LISTITEMSADD .vAddList
  FETCH C1 INTO vAddList
ENDWHILE
 
The selection command currently returns 3459 rows when using Browse almost 
instantly.
 
I notice, too, that I can no longer use the mouse’s scrolling wheel to 
move the data up or down – whether a row is selected or not.
 
Has anything changed that means I need to revamp my code?
 
Regards,
Alastair.
 
 
 

Reply via email to