Home > Archive > FoxPro Help and Support > June 2005 > INSERT INTO command









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author INSERT INTO command
Kenji

2005-06-15, 3:25 am

I am using FoxPro database. I want to select certain records from one
table(master.dbf) and insert into another table(empty.dbf). I did try the
following sql statement, but the syntax error happened.

INSERT INTO "C:\EMPTY"
SELECT A.*
FROM "C:\MASTER" A, "C:\ORDER" B
WHERE A.ITEMNO=B.ITEMNO

empty.dbf and master.dbf having the identical table structure.
Please kindly help.
Thanks!


Fred Taylor

2005-06-15, 3:25 am

You don't need to specify the path, all you need is the alias (if the tables
are already open).

I also think you will need VFP9 in order to work correctly, as I don't think
earlier versions recognized an insert from a select.

Also EMPTY is not a good table name as EMPTY is a reserved word.

INSERT INTO EMPTY ;
SELECT MASTER.* FROM MASTER, ORDER ;
WHERE MASTER.ITEMNO=ORDER.ITEMNO


--
Fred
Microsoft Visual FoxPro MVP


"Kenji" <yong@mascotasia.com> wrote in message
news:uA0k%23LVcFHA.464@TK2MSFTNGP15.phx.gbl...
>I am using FoxPro database. I want to select certain records from one
> table(master.dbf) and insert into another table(empty.dbf). I did try the
> following sql statement, but the syntax error happened.
>
> INSERT INTO "C:\EMPTY"
> SELECT A.*
> FROM "C:\MASTER" A, "C:\ORDER" B
> WHERE A.ITEMNO=B.ITEMNO
>
> empty.dbf and master.dbf having the identical table structure.
> Please kindly help.
> Thanks!
>
>



Paul Pedersen

2005-06-15, 3:25 am

You forgot the semicolons.


"Kenji" <yong@mascotasia.com> wrote in message
news:uA0k%23LVcFHA.464@TK2MSFTNGP15.phx.gbl...
>I am using FoxPro database. I want to select certain records from one
> table(master.dbf) and insert into another table(empty.dbf). I did try the
> following sql statement, but the syntax error happened.
>
> INSERT INTO "C:\EMPTY"
> SELECT A.*
> FROM "C:\MASTER" A, "C:\ORDER" B
> WHERE A.ITEMNO=B.ITEMNO
>
> empty.dbf and master.dbf having the identical table structure.
> Please kindly help.
> Thanks!
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com