Unfortunatly that syntax doesn't work if FoxPro. You have to do it in 2 steps, select the data you want and then insert it into the table. I included a couple of examples, but there are many other ways of doing it.
Hope this helps,
Bo Durban
SELECT ID FROM bah INTO CURSOR curTemp
SELECT foo
APPEND FROM (DBF("curTemp")
USE IN "curTemp"
-or-
SELECT ID FROM bah INTO CURSOR curTemp
SELECT curTemp
SCAN
SCATTER MEMO NAME oTemp
SELECT foo
APPEND BLANK
GATHER MEMO NAME oTemp
ENDSCAN
USE IN "curTemp"
what i actually want to do is return a random record.
I plan to create a cursor with a randNum column that's just an auto-increment column and the ID column containing the key of the row i want to return. that's why i needed the insert select, but i'll try your advice, thanks! And is there another approach to return a random row?
this might be a stupid question but how do i call stored procedures? I refrained from using them and instead defined all code in programs because i didn't know how to call em.
also, is there a good reference site about visual foxpro? MSDN is not really helpful.
You can do the insert and repace functions in a single command...
INSERT INTO myDBF FROM MEMVAR
The above code inserts a record into the table myTable from the MEMVAR previously populated. The idea is that the TABLE activity will be fast. Memory manipulations dont hold other users wheras the INSERT into TABLE holds others as well as the erplace etc functions. If this is done in one act, you could surely feel better.
Hope this helps
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.