Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pass Through Speed
Message
From
16/04/2004 09:05:51
 
 
To
16/04/2004 07:22:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00895472
Message ID:
00895500
Views:
20

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.
Previous
Reply
Map
View

Click here to load this message in the networking platform