Re: Foxpro sql limitations
From: Rush Strong (rush.strong)
Date: 07/13/04
- Next message: JPC: "Re: Remote View Problem"
- Previous message: Mark McCasland: "Re: Foxpro sql limitations"
- In reply to: Steve G: "Foxpro sql limitations"
- Next in thread: Thomas Ganss: "Re: Foxpro sql limitations"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 16:44:21 -0700
"Steve G" <steve@tracorp.com> wrote in message
news:5b42aaf3.0407131356.e1d9b6f@posting.google.com...
> Hello,
>
> I am developing an ASP application that has to interface with a Foxpro
> database for some things, in addition to a SQL Server database. I am
> connecting through ODBC and using Jscript as my language of choice.
>
> I have programmed thus far with the knowledge of a few of Foxpro's
> 'quirks' that make it so fun to program with. My favorite is the one
> where you can't have more than 20 items in an IN clause. After all,
> who would possibly need a clause with more than 20 items? Would such
> a gargantuan beast even have a use? </sarcasm> As a programmer, I
> see no logical reason why this limitation is the programmer's
> responsibility to deal with as opposed to the DBMS query engine. But
> I take this in stride with the knowledge that it wasn't my choice to
> use Foxpro.
>
> But now I have a new one that I've run into, and I get the nauseating
> feeling that the worst solution is the only one. I am now executing
> statements where it comes back and says they are too long:
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> [Microsoft][ODBC Visual FoxPro Driver]SQL: Statement too long.
>
> This is occuring on a statement in which the example has 178 4-digit
> numbers in the IN clause (broken up into 8 nice groups of 20 each,
> plus another 18). The entire statement looks remarkably similar to
> this:
>
> SELECT vehicle_id FROM yes02v WHERE ml_id IN (1381, 2166, 2290, 2292,
<snip>
> 6953, 6954, 7005, 7006, 7007, 7008, 7022, 7026, 7083, 7108, 7109,
> 7122, 7153, 7157) ORDER BY fleet_num
I'm not an ODBC pro, but if I was doing this in native Fox I'd put all those
ml_id values in a cursor (one field - ml_id), then use:
SELECT vehicle_id, fleet_num ;
FROM yes02v, MyCursor ;
WHERE yes02v.ml_id = MyCursor.ml_id ;
ORDER BY fleet_num
- Rush
- Next message: JPC: "Re: Remote View Problem"
- Previous message: Mark McCasland: "Re: Foxpro sql limitations"
- In reply to: Steve G: "Foxpro sql limitations"
- Next in thread: Thomas Ganss: "Re: Foxpro sql limitations"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|