Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UDFs in SQL SELECT
Message
De
13/03/2012 13:06:54
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Titre:
UDFs in SQL SELECT
Versions des environnements
Visual FoxPro:
FoxPro Windows
OS:
Windows XP SP2
Divers
Thread ID:
01538216
Message ID:
01538216
Vues:
82
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform