Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inefficient query
Message
De
24/01/2007 17:36:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01188966
Message ID:
01188996
Vues:
22
>
>select *, 'Missing' as cInfo from FirstResult where ID not in (select ID from mySecondResult) ;
>union all ;
>select *, 'Extra ' as cInfo from mySecondResult where ID not in (select ID from FirstResult)


Excellent idea. :)

I am starting to see that the query is not my problem. This little exercise is part of a Fox-enabled web site using Active Foxpro Pages. The query itself appears to only take a fraction of a second to run in fox, but the code that produces results rows for the html table is slow, now that I test them both.

Assuming temp to be the result cursor from the previous query, does this look like an inefficient use of TEXTMERGE to produce my html result set rows? This produces one HTML table row per query result, the resulting text is then written out to the client with response.write()
Function CreateTableRows
	Local cText,i
	i = 0
	If !Used("temp")
		Return []
	Endif
	cText = []
	Select temp
	Scan
		i = i + 1
		TEXT TO cText ADDITIVE TEXTMERGE NOSHOW
  <tr bgcolor="#dcdcdc" class="QueryTable">
    <td width="103" bgcolor="#dcdcdc" class="FieldHeadings QueryResults">
      <input name="WorkCode<<i>>" readonly type="text" class="TableHeadings" id="WorkCode<<i>>" value="<<temp.wcode>>" size="15" onclick="MM_goToURL('parent','<<>>');return document.MM_returnValue" />
    </a> </td>
    <td width="360"><span class="QueryResults">
      <input name="Borrowername<<i>>" readonly type="text" id="Borrower_Fname<<i>>" value="<<temp.borrowername>>" size="50"/>
    </span></td>
    <td bgcolor="#dcdcdc"><span class="QueryResults">
      <input name="Loan<<i>>" readonly type="text" class="TableHeadings" id="Loan<<i>>"  onclick="MM_goToURL('parent','<<>>');return document.MM_returnValue" value="<<temp.display_loan>>" />
    </span></td>
    <td bgcolor="#dcdcdc"><span class="QueryResults">
      <input name="Parcel<<i>>" readonly type="text" id="Parcel<<i>>" value="<<temp.acct>>" />
    </span></td>
  </tr>
		ENDTEXT
	Endscan
	Return cText
Endfunc
Jim Newsom
IT Director, ICG Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform