>>>>>SELECT * ; >>>>> FROM crsTestAcctContiUniCont; >>>>> WHERE crsTestAcctContiUniCont.iTransact NOT IN (SELECT iTransact FROM TransHist) ; >>>>> INTO CURSOR crsUpdate >>>>>>>>>
>>>>select ; >>>> TA.* ; >>>> from ; >>>> crsTestAcctContiUniCont TA ; >>>> inner join ; >>>> TransHist TH ON ; >>>> TA.iTransact = TH.iTransact ; >>>> AND (TA.Field1 # TH.Field1 ; >>>> OR TA.Field2 # TH.Field2 ; >>>> OR TA.Field3 # TH.Field3 ... ) ; >>>>union ; >>>> select ; >>>> TA.* ; >>>> from ; >>>> crsTestAcctContiUniCont TA ; >>>> where ; >>>> TA.iTransact NOT IN (SELECT TH.iTransact FROM TransHist TH) >>>>>>>
>CLEAR >CREATE CURSOR test1 (v1 i) >CREATE CURSOR test2 (v1 i) >FOR ix=1 TO 5 > INSERT INTO test1 VALUES (m.ix) > INSERT INTO test2 VALUES (m.ix) >ENDFOR > >SELECT * ; > FROM test1 t1 ; > left JOIN test2 t2 ON (t1.v1 = t2.v1 OR udf()) > >FUNCTION udf >? "Should never be called" >>
CLEAR CREATE CURSOR test1 (v1 i) CREATE CURSOR test2 (v1 i) FOR ix=1 TO 3 INSERT INTO test1 VALUES (m.ix) INSERT INTO test2 VALUES (m.ix) ENDFOR ? "here vfp is changed" * here VFP call it one time only SELECT * ; FROM test1 t1 ; where t1.v1 > 0 OR udf() ? "here vfp is changed" * here VFP call it one time only SELECT * ; FROM test1 t1,test2 t2; where t1.v1 >0 OR t2.v1>0 OR udf() ? ? "here vfp is not changed" * here VFP call udf useless SELECT * ; FROM test1 t1 , test2 t2 ; where t1.v1 = t2.v1 OR udf() * But ...... ? ? "here vfp is changed" * here VFP call it one time only and don't execute the comparison SELECT * ; FROM test1 t1 , test2 t2 ; where t1.v1>0 OR t1.v1 = t2.v1 OR udf() ? ? "here vfp is changed" * here VFP call it one time only SELECT * ; FROM test1 t1 , test2 t2 ; where t1.v1 = t2.v1 OR t1.v1>0 OR udf() FUNCTION udf * ? "Should never be called" * Fabio's comment: * this is incorrect because VFP check the function for a Boolean datatype, * this is useless, but the SQL engine work in this manner ? "Should once be called" RETURN .f.As it often happens, incoherent behaviors, but this is an old history.