>-----Original Message-----
>From: Alexander S.Kresin [mailto:a...@belacy.belgorod.su] 
>Sent: Tuesday, June 09, 2009 1:03 PM
>To: Harbour Project Main Developer List.
>Subject: [Harbour] Re: How to simulate select ... where ... 
>order by ...limit ... offset
>
>  > If it's not a problem, you may send it to the list, probably
>> it would be useful for other developers, or even for Harbour.
>> 
>
>  Attached.

Here isn't join, subselect, acces to remote table and many othes things.
For DBF the best is dbEval(), __dbCopy(), __dbJoin() etc.. For Example
with Mediator Server :

  If Firmy->( dbInfo( 1)) // DBF's

   scTemp := TempFile( UpPath( Zrodlo()) + 'TMP\')
   scTemp := StrTran( scTemp, '.', '')
   Firmy->(  __dbCopy( scTemp, { 'nazwa', 'miasto', 'ulica',
'id_firma'},  "'"{ || Upper( "'" + AllTrim( slct)) + "' $ Upper( " +
tnaz[ n] + ")}",,,,, 'DBFCDX'))
   dbUseArea( .t., 'DBFCDX', scTemp, 'FrmFor', .f.)

  Else // Oracle

   slct := "select nazwa, miasto, ulica, id_firma_k from firmy where
upper( " + tnaz[ n] + ") like '%" + Upper( AllTrim( slct)) + "%'"
   MedSetQry( slct, -1, .t., .F., .F., .F.), dbUseArea( .t., "MEDNTX",
"FrmFor" + operator[ 7], 'FrmFor', .T., .F. )

  End

>From hunderds of thousands records of source table, the result is the
same time.
 

Regards,
Marek Horodyski
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to