Hi All

How do I transfer the contents of a cursor created by an sql select into a
table?

SELECT * FROM issues WHERE keyfld=Tfind INTO cursor toutput

I have got the select in a do while loop to pick-up steel issued to jobs
(there can be multilple).

I could probably do it with a join, but its tooooo hot and my brain packed
in two hours ago!

Phwew

Steve

Re: cursors by Fred

Fred
Thu Jun 23 10:03:06 CDT 2005

If you add the NOFILTER keyword to your SELECT, that will prevent you from
gettng a "filtered view" of your issues table. You can than take your
cursor toutput and append it to some other table. If you don't do the
NOFILTER, you'll get all the records from the issues table.

SELECT * FROM issues WHERE keyfld=Tfind INTO CURSOR toutput NOFILTER
SELECT yourothertable
APPEND FROM DBF("toutput")

--
Fred
Microsoft Visual FoxPro MVP


"steve" <steve.fisher@fernite.co.uk> wrote in message
news:40sexdrmq222.yxvslkhocieq$.dlg@40tude.net...
> Hi All
>
> How do I transfer the contents of a cursor created by an sql select into a
> table?
>
> SELECT * FROM issues WHERE keyfld=Tfind INTO cursor toutput
>
> I have got the select in a do while loop to pick-up steel issued to jobs
> (there can be multilple).
>
> I could probably do it with a join, but its tooooo hot and my brain packed
> in two hours ago!
>
> Phwew
>
> Steve



Re: cursors by Ook

Ook
Thu Jun 23 10:04:30 CDT 2005

SELECT * FROM issues WHERE keyfld=Tfind INTO TABLE toutput ?


"steve" <steve.fisher@fernite.co.uk> wrote in message
news:40sexdrmq222.yxvslkhocieq$.dlg@40tude.net...
> Hi All
>
> How do I transfer the contents of a cursor created by an sql select into a
> table?
>
> SELECT * FROM issues WHERE keyfld=Tfind INTO cursor toutput
>
> I have got the select in a do while loop to pick-up steel issued to jobs
> (there can be multilple).
>
> I could probably do it with a join, but its tooooo hot and my brain packed
> in two hours ago!
>
> Phwew
>
> Steve



SV: cursors by Anders

Anders
Thu Jun 23 12:27:49 CDT 2005

INSERT INTO MyTable (col1, col2, ,,, ) SELECT f1, f3,... FROM issues WHERE
keyfld=M.tfind

-Anders


Den 05-06-23 16.27, i artikeln 40sexdrmq222.yxvslkhocieq$.dlg@40tude.net,
skrev "steve" <steve.fisher@fernite.co.uk>:

> Hi All
>
> How do I transfer the contents of a cursor created by an sql select into a
> table?
>
> SELECT * FROM issues WHERE keyfld=Tfind INTO cursor toutput
>
> I have got the select in a do while loop to pick-up steel issued to jobs
> (there can be multilple).
>
> I could probably do it with a join, but its tooooo hot and my brain packed
> in two hours ago!
>
> Phwew
>
> Steve


Re: cursors by steve

steve
Fri Jun 24 04:33:14 CDT 2005

On Thu, 23 Jun 2005 08:03:06 -0700, Fred Taylor wrote:

> If you add the NOFILTER keyword to your SELECT, that will prevent you from
> gettng a "filtered view" of your issues table. You can than take your
> cursor toutput and append it to some other table. If you don't do the
> NOFILTER, you'll get all the records from the issues table.
>
> SELECT * FROM issues WHERE keyfld=Tfind INTO CURSOR toutput NOFILTER
> SELECT yourothertable
> APPEND FROM DBF("toutput")

Thanks Fred,

Exactly what I was looking for.

Just read my garbled message from yesterday - and was suprised anybody
could make sense of it. Its a lot cooler today (and raining!). It was so
hot yesterday, I now know how a boil in the bag meal feels.

thx

Steve

Re: cursors by Fred

Fred
Fri Jun 24 09:59:13 CDT 2005

"steve" <steve.fisher@fernite.co.uk> wrote in message
news:1v4zz6lfv784j$.il0pmf9pt1p2.dlg@40tude.net...
> On Thu, 23 Jun 2005 08:03:06 -0700, Fred Taylor wrote:
>
>> If you add the NOFILTER keyword to your SELECT, that will prevent you
>> from
>> gettng a "filtered view" of your issues table. You can than take your
>> cursor toutput and append it to some other table. If you don't do the
>> NOFILTER, you'll get all the records from the issues table.
>>
>> SELECT * FROM issues WHERE keyfld=Tfind INTO CURSOR toutput NOFILTER
>> SELECT yourothertable
>> APPEND FROM DBF("toutput")
>
> Thanks Fred,
>
> Exactly what I was looking for.
>
> Just read my garbled message from yesterday - and was suprised anybody
> could make sense of it. Its a lot cooler today (and raining!). It was so
> hot yesterday, I now know how a boil in the bag meal feels.
>
> thx
>
> Steve

Glad it worked for you.

Where are you at? It's been around 110 to 113 here in Phoenix the last few
days. Doesn't get much hotter than that anywhere, though it's just
beginning to warm up here. <g>

--
Fred
Microsoft Visual FoxPro MVP