Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: SQL SELECT Statement UDF Executes Triple On First Recor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
BUG: SQL SELECT Statement UDF Executes Triple On First Recor
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01022053
Message ID:
01022053
Vues:
72
SYMPTOMS
A user-defined function (UDF) called within a Expression as a select item in an SQL SELECT statement
executes Triple for the first record of the source table.

CAUSE
The first iteration of the SQL SELECT statement creates and sizes the columns in the output.
On the internal C++ code exists a call nesting bug.

STATUS
Not fixed.

Steps to Reproduce Behavior
 * start of SQLUDF.PRG
   *
   * This program selects records from the input table and calculates a
   * running total + 0 in the output table by using a UDF.
CLEAR	
CREATE CURSOR SQLUDF ( nField1 N(10,0) )
INSERT INTO SQLUDF VALUES ( 10 )

   nRunningTot = 0        && initialize running total to 0
   nIterations = 0        && initialize iteration counter to 0

   SELECT *, Add_Em(nField1)+ 0 as nRunTotal FROM SQLUDF INTO CURSOR temp
   BROWSE NOWAIT

   PROCEDURE Add_Em
        PARAMETERS tnFld1
           nIterations = nIterations + 1  && Increment iteration counter

           ? "Record Number:        "+ALLTRIM(STR(RECNO())) + ;
              CHR(13)+ "Number of Iterations: "+ALLTRIM(STR(nIterations))
           
           nRunningTot=nRunningTot + tnFld1     && Calculate running total
       RETURN nRunningTot
    END PROCEDURE

   *End of SQLUDF.PRG
						
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform