PRB: SQL SELECT Statement UDF Executes Twice On First Record (133001)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft FoxPro for Windows 2.6a
- Microsoft FoxPro for MS-DOS 2.6a
- Microsoft FoxPro for Macintosh 2.6a
This article was previously published under Q133001 SYMPTOMS
A user-defined function (UDF) called as a select item in an SQL SELECT
statement executes twice 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. The first iteration therefore executes once to do
this and once to determine what data to return from the first record.
RESOLUTION
Insert code in the UDF to suppress its execution on the first iteration.
Please see the examples in the More Information section.
STATUS
This behavior is by design.
REFERENCES
For more information about a similar behavior of a UDF, please see the
following article in the Microsoft Knowledge Base:
124402 Calling a User-Defined Function (UDF) from SQL SELECT
| Modification Type: | Major | Last Reviewed: | 12/3/2003 |
|---|
| Keywords: | KB133001 |
|---|
|