Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: only null values in SELECT member can to used
Message
From
02/05/2004 06:47:45
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00900095
Message ID:
00900174
Views:
19

SELECT myParent.* FROM myParent ;
WHERE myParent.rId = Null ;
INTO ARRAY ZZ


Sorry Sergey, where i have written this query ?

The thread it is not related to the NULL comparison,
but to the seek of a field with a NULL value.

The concept difference is substantial.

If you remove the index, VFP don't fire any error:
WITH CREATEOBJECT('session')
	SET DATASESSION TO .DatasessionId
	CLEAR
	CREATE CURSOR myParent ( rId I ) && UNIQUE)
	FOR k=1 TO 10
	  INSERT INTO myParent VALUES (M.K)
	NEXT
	ON ERROR ? 'ERROR >>>>>>>>>>   ',MESSAGE()

	CREATE CURSOR myCursor( fkId i NULL)
	INSERT INTO	myCursor VALUES (NULL)
	SYS(3054,12)

	SELECT myParent.* FROM myParent,myCursor WHERE myParent.rId=myCursor.fkId INTO ARRAY ZZ 	&& this not fire THE INDEX error
	
	SELECT myParent.* FROM myParent          WHERE myParent.rId=myCursor.fkId INTO ARRAY ZZ 	&& this     fire THE INDEX error
		
	
*!*		SELECT myParent.* FROM myCursor X JOIN myParent ON myParent.rId=X.fkId AND myParent.rId=NULL	INTO ARRAY ZZ 	&& this     fire THE INDEX error
*!*		SELECT myParent.* FROM myCursor X JOIN myParent ON myParent.rId=X.fkId AND myParent.rId IS NULL INTO ARRAY ZZ 	&& this not fire THE INDEX error
*!*		SELECT myParent.* FROM myCursor X JOIN myParent ON myParent.rId=X.fkId OR  myParent.rId=NULL	INTO ARRAY ZZ	&& this not fire THE INDEX error

	ON ERROR
ENDWITH
Then:
you can build a indexed Parent Lookup table
and a Child table with a nullable foreing key to the Parent table without problem ?

On VFP the Answer is NO. ( on MS SQL it is YES )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform