Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Pass Through Speed
Message
De
16/04/2004 09:05:51
 
 
À
16/04/2004 07:22:34
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00895472
Message ID:
00895500
Vues:
19

Scan

part_no = "'%" + myRelDwg.dwgno + "%'"

= SQLSETPROP(pdm_var.as400_connection_2, 'asynchronous', .F.)
= SQLPREPARE(pdm_var.as400_connection_2, "Select itnbr, vndnr From AMFLIB6.ITEMASA Where AMFLIB6.ITEMASA.itnbr LIKE &part_no", 'what_vendor')

= SQLEXEC(pdm_var.as400_connection_2)

EndScan


Steven, i can change to:
= SQLSETPROP(pdm_var.as400_connection_2, 'asynchronous', .F.)
= SQLPREPARE(pdm_var.as400_connection_2, "Select itnbr, vndnr From AMFLIB6.ITEMASA Where AMFLIB6.ITEMASA.itnbr LIKE ?m.part_no", 'what_vendor')
Scan
part_no = "'%" + myRelDwg.dwgno + "%'"
= SQLEXEC(pdm_var.as400_connection_2)
* exist other code here ? see point a)
EndScan
but:
a) a scan with a fixed select only, is useless

b) AFAIK, a backend cannot use un index for LIKE '%BLABLA%'

solution ? (not verified):
sLike = ''
Scan
  sLike = m.sLike + "'%" + myRelDwg.dwgno + "%'"
ENDSCAN
= SQLSETPROP(pdm_var.as400_connection_2, 'asynchronous', .F.)
= SQLEXEC(pdm_var.as400_connection_2,"Select itnbr, vndnr From AMFLIB6.ITEMASA Where AMFLIB6.ITEMASA.itnbr LIKE "+STRTRAN(m.sLike,"%''%","%' OR AMFLIB6.ITEMASA.itnbr LIKE '%),'what_vendor')
if sLike is too long, you can do a external cycle and split it.

Other way is make all into the backend.

Sorry, but I'm not a AS400 expert.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform