where condition too complex?  
Author Message
dmatthew





PostPosted: Visual FoxPro General, where condition too complex? Top

Hi,

Basically I have a where statement in my code that is similar to this:

"where productcode in ('0001','0002','0003'.....'0020')" and Foxpro is telling me that the SQL code is too complex. The output file is an Excel file so I suppose I could just extract the particular product codes that I need in Excel but I was just wondering if there was a way to bypass this "SQL Code is too complex" conondrum and just grab the numerous product codes that I need.

Thanks! :)




Visual FoxPro1  
 
 
Garrett Fitzgerald





PostPosted: Visual FoxPro General, where condition too complex? Top

Basically I have a where statement in my code that is similar to this:

"where productcode in ('0001','0002','0003'.....'0020')" and Foxpro is telling me that the SQL code is too complex.

You want to check out the SYS(3055) function. That should help you with that.


 
 
Lakshminarayana





PostPosted: Visual FoxPro General, where condition too complex? Top

may be too many product codes. please split your query into 2 or three. direct the output to 3 or 4 cursor/dbf then merge it into one, then export it as excel file.

thanks and regards

(lakshminarayana r)

(chat id)



 
 
dmatthew





PostPosted: Visual FoxPro General, where condition too complex? Top

Looks like I may have to go throught his route. Thanks guys! :)

 
 
Garrett Fitzgerald





PostPosted: Visual FoxPro General, where condition too complex? Top

Looks like I may have to go through this route. Thanks guys! :)

Which one is "this route" :-) The SYS function, or splitting up the query


 
 
Tamar E. Granor





PostPosted: Visual FoxPro General, where condition too complex? Top

Put the values you want to match in a cursor and JOIN that cursor in the query. That way, no matter how many are in the list, you won't ever bump against any limits.

Tamar


 
 
CetinBasoz





PostPosted: Visual FoxPro General, where condition too complex? Top

local array aCodes[1]
alines(aCodes, '0001,0002,0003.....0020', .t., ',')
dimension aCodes[ alen(aCodes,1), 1 ]
create cursor crsCodes (myCode c(10))
append from aCodes

* ... inner join crsCodes on myTable.productcode == crsCodes.myCode"

use in 'crsCodes'