[Babase] Foxpro update statement question
Karl O. Pinc
kop at meme.com
Mon Apr 9 11:45:33 EDT 2007
On 04/09/2007 09:14:41 AM, Lacey Maryott wrote:
> Goodmorning,
>
> I am struggling with some SQL and could use some help:
>
However, in order to correct the sname of VOI to VOI and not VOL for
> the period 04-19-1984 to 08-31-1989, I was thinking there must be
> some update statement that can be used to quickly change it. But
> what I am not sure of is how to update all of those dbfs, (65 of
> them) at one time.
> UPDATE (something);
>
> SET sname = "VOI"
>
> WHERE sname = "VOL"
>
> AND DATE Between "1984-04-19" and "1989-08-31";
>
> the naming convention for these files is ANMMYY
>
Becase they're all in different dbf files there's no way
to do it in one update statement.
You could write a foxpro program to execute all the different
update statements, but I think it'd be eaiser to use a macro
to write all the update statements.
http://en.wikipedia.org/wiki/Macro#Keyboard_and_mouse_macros
The process would be something like this:
Put all the dbf files into one directory (folder).
Start regular foxpro, not babase, and set your
default path to the directory with the dbf files
so that foxpro can find the dbf files without
you having to do anything special. (You should
just be able to use the name of a dbf file
in the UPDATE statement and have it work.)
You then copy the list of dbf file names that are in
the folder into a text document and use a macro
to transform all the file names into the update
statements you want. Then you cut and paste
the update statements into the foxpro "DO"
window to run them all "at once".
I always use emacs for my text manipulation (see
http://www.emacs.uniyar.ac.ru/doc/em24h/emacs110.htm
or
http://www.gnu.org/software/emacs/manual/html_node/Keyboard-Macros.html#Keyboard-Macros
for an intro on emacs macros) but I hear
that Word has a macro facility.
If you felt like using emacs you could do so on
papio and cut and paste from there. You'd probably
do best to sign up for O'Reilly's safari
and read the macro chapter of the Learning
GNU Emacs book. http://safari.oreilly.com/0596006489?tocview=true
Karl <kop at meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
More information about the Babase
mailing list