Microsoft KB Archive/178494

= PRB: More Than Nine Functions in Left Join Causes Memory Error =

Article ID: 178494

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q178494



SYMPTOMS
If there are more than nine functions in your left join SQL statement the following error occurs:

There is not enough memory to complete this operation.



RESOLUTION
Create separate User Defined Functions (UDFs) to eliminate the large number of functions in left join.

Create a program called Ztest.prg that contains the functions called by the UDF shown below: FUNCTION testfun1 RETURN STR(a.Row1,4)+STR(a.Row2,4)+STR(a.Row3,4)+STR(a.Row4,4) ; +STR(a.Row5,4)

FUNCTION testfun2 RETURN STR(b.Row1,4)+STR(b.Row2,4)+STR(b.Row3,4)+STR(b.Row4,4) ; +STR(b.Row5,4) Use the following code to execute the new SQL SELECT statement that calls the UDF code: SET PROCEDURE TO Ztest.prg SELECT * FROM test1 a LEFT JOIN test2 b ON testfun1 = testfun2



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
  Use the following commands to create two tables. Each table contains one record with five numeric fields: CREATE TABLE test1 (row1 n(4),row2 n(4),row3 n(4),row4 n(4), ;     row5 n(4)) CREATE TABLE test2 (row1 n(4),row2 n(4),row3 n(4),row4 n(4), ;     row5 n(4)) INSERT INTO test1 VALUE (1,2,3,4,5) INSERT INTO test2 VALUE (1,2,3,4,5)   Issue the command below in the Command window: SELECT * FROM Test1 a LEFT JOIN Test2 b ON ; STR(a.Row1,4)+STR(a.Row2,4)+STR(a.Row3,4)+STR(a.Row4,4) +STR(a.Row5,4) ; = STR(b.Row1,4)+STR(b.Row2,4)+STR(b.Row3,4) +STR(b.Row4,4)+STR(b.Row5,4) 

Keywords: kbprb KB178494

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.