Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong with this string??

Status
Not open for further replies.

inteleserve

IS-IT--Management
Dec 13, 2002
75
US
The string below works in foxpro8 but I need to get this to work in 2.6 for unix. Obviously my directories are different from going from NT to unix, but that shouldn't matter. I am thinking that 2.6 just needs this string entered in differently...

PLEASE HELP ME FOR THE LOVE OF GOD!!!

[gorgeous]
Erin Goodrich


insert into /u/server/data/temp.dbf (fullname) select (fullname) from /u/server/data/alliedma.dbf where phone!="
 
I got a syntax error when I tried this on foxpro 2.6 on unix

INSERT INTO /data/tmp.dbf (fullname) SELECT (fullname) FROM /data/DATAFILE.dbf where phone!=" "

 
Erin,
I'm afraid it's more than a simple syntax problem. The SQL INSERT syntax with a SELECT wasn't introduced until VFP 8.0. There isn't anything like it even in VFP 7.0, much less FPU.
About the best you can do is:
Code:
SELECT (fullname) FROM /data/DATAFILE.dbf ;
 where !EMPTY(phone);
 INTO Cursor curTemp
SELECT curTemp && probably not needed
SCAN
 INSERT INTO /data/tmp.dbf (fullname) ;
   VALUES (curTemp.fullname)
ENDSCAN
USE && kill the cursor
Rick
 
Hi,

The correct syntax is:

INSERT INTO <dbf name>
[(<field name1>
[, <field name2> [, ...]])]
VALUES (<expr1>
[, <expr2> [, ...]])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top