Environment versions
Visual FoxPro:
FoxPro Windows
I wrote a small FPW 2.6a prog to pull data from an old app's Transact.DBF. Simplifying things, here's the problem I'm seeing:
SELECT Transact.*, "Constant" AS ExtraCol FROM Transact WHERE ... INTO TABLE Table1
(pulls 966 records, as I expected)
SELECT Table1.*, IIF(Col1 = Col2, 1, 0) AS SameCnt FROM Table1 INTO Table2
(pulls 966 records -- all of the Table1 data, plus the SameCnt column, as expected)
SELECT Table1.*, MyUDF(Col1, Col2) AS SameCnt FROM Table1 INTO Table2
(pulls only 1 record!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
...
RETURN
PROCEDURE MyUDF
PARAMETERS pCol1, pCol2
RETURN IIF(pCol1=pCol2, 1, 0)
There are no GROUP BYs. I can't figure out why MyUDF is only pulling one record. I've tried hard-wiring the PATH and the DEFAULT,
setting both just to the folder that FPW is in and put by prog file there. I've tried MyUDF defined as a PROC and as a FUNC in the
calling program, and as a separate PRG file in the same folder as the rest. Any environmental settings
or other factors that could cause this behavior?
TIA,
-mark
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only