Re: using Select SQL syntax and performance issues



Hi ddobier:

You could use the CREATE CURSOR command to make the cursor and then the
APPEND FROM command to populate the empty cursor.

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

>Can I copy the data from one table into a cursor with the copy command?
It
>looks like from the help menu that it has to be to a file or array.

>Thanks.

>"Dan Freeman" wrote:

> Foxpro's SQL implementation works best with subsets.
>
> If you just want to move an entire table to a temp table, use the COPY
> command.
>
> With a table of any size (and without joins), REPLACE will almost always
be
> faster than UPDATE.
>
> Generally, slow queries are the result of a lack of Rushmore optimization.
> See the help file for more information.
>
> Dan
>
>
>
>
>
> ddobier wrote:
> > Hello. I'm new to foxpro but have a VB and sql server background. I'm
> > trying to rewrite some existing foxpro programs that are very
> > inefficient. What I'm noticing is that the majority of my sql
> > statements are very slow to process. The table I'm either updating or
> > searching through has approx 150000 records. Here's what I'm seeing:
> >
> > update cust set is_new = .T. - This statement takes about 4 minutes to
> > execute. If I change it to use the replace function it processes
> > immediately. I would think it would to the same for the update
> > statement as I'm updating all records. Any thoughts as to why this is
> > taking so long?
> >
> > select field1, field2, field3, field4 into cursor1 readwrite - this
> > takes
> > 1.5 minutes to process 150000 records. I would think this would be
> > almost instantaneous as it's displaying all records. What gives? I
> > moved the data files locally and see the same sluggish performance.
> >
> > To summerize, any sql command I give is very slow. Is this just how
> > Foxpro is with sql statements? On some other SELECTS that are slow I
> > checked and it's using the indexes for the joins. Is there some
> > configuration option I must set like packet size, batch size, ....?
> >
> > Thanks for any assistance you may provide.
>
>
>


.



Relevant Pages

  • Re: Cannot set CDX index on DBF file from C#
    ... > I am using .NET framework 2.0 to open Foxpro DBF files. ... > the connection / command process, none of the actual indexes ... > within the CDX file are being selected, so when I run a select SQL ... the FoxPro Index command requires exclusive use of the ...
    (microsoft.public.fox.helpwanted)
  • System.InvalidOperationException when attempting to add a record
    ... I am working on a VB.NET application that needs to add records to a FoxPro ... populate a DataRow and add it to the dataset. ... Standard stuff I've done many times with SQL Server and Access databases. ... command to specify the index to use. ...
    (microsoft.public.data.ado)
  • System.InvalidOperationException when attempting to add record
    ... I am working on a VB.NET application that needs to add records to a FoxPro ... populate a DataRow and add it to the dataset. ... Standard stuff I've done many times with SQL Server and Access databases. ... command to specify the index to use. ...
    (microsoft.public.data.oledb)
  • Re: Select Sum(nField)
    ... Use Code references to spot the places that need changing. ... So VFP9 is consistent with SQL Server. ... I have a SQL command in VFP8 ... Sele Sumfrom History where cEmpCode=lcEmpCode Into Cursor ...
    (microsoft.public.fox.programmer.exchange)
  • Re: using Select SQL syntax and performance issues
    ... I'm new to foxpro but have a VB and sql server background. ... > statement as I'm updating all records. ... any sql command I give is very slow. ...
    (microsoft.public.fox.helpwanted)

Loading