Hi,

I have a SQL command in VFP8

Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor tHistory

If there is no Employee that matches lcEmpCode,
the command returns a cursor with 0 records.

I used the same command in VFP9 and it returned a cursor
with one record with a NULL value. Is this correct?


Thanks,
Herbert

Re: Select Sum(nField) by HerbertDB

HerbertDB
Tue Apr 03 02:33:03 CDT 2007

Just read What New in VFP9. Its a new feature.


"HerbertDB" <herbertdb@nospam.com> wrote in message
news:eXCKTqbdHHA.1080@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I have a SQL command in VFP8
>
> Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor
> tHistory
>
> If there is no Employee that matches lcEmpCode,
> the command returns a cursor with 0 records.
>
> I used the same command in VFP9 and it returned a cursor
> with one record with a NULL value. Is this correct?
>
>
> Thanks,
> Herbert
>
>



Re: Select Sum(nField) by Anders

Anders
Tue Apr 03 08:13:10 CDT 2007

If you do the same from VFP against a SQL Server table you do get a row with
null in your return cursor. So VFP9 is consistent with SQL Server.
-Anders

"HerbertDB" <herbertdb@nospam.com> wrote in message
news:%23Rs7MCcdHHA.4516@TK2MSFTNGP04.phx.gbl...
> Just read What New in VFP9. Its a new feature.
>
>
> "HerbertDB" <herbertdb@nospam.com> wrote in message
> news:eXCKTqbdHHA.1080@TK2MSFTNGP02.phx.gbl...
>> Hi,
>>
>> I have a SQL command in VFP8
>>
>> Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor
>> tHistory
>>
>> If there is no Employee that matches lcEmpCode,
>> the command returns a cursor with 0 records.
>>
>> I used the same command in VFP9 and it returned a cursor
>> with one record with a NULL value. Is this correct?
>>
>>
>> Thanks,
>> Herbert
>>
>>
>
>



Re: Select Sum(nField) by HerbertDB

HerbertDB
Wed Apr 04 02:01:02 CDT 2007

Can this feature be disabled? Most of my queries I add the
result to a variable. Since VFP9 returns Null instead on no record,
my variable now becomes NULL or 0.


"Anders Altberg" <anders.altberg> wrote in message
news:OiVXaHfdHHA.4964@TK2MSFTNGP04.phx.gbl...
> If you do the same from VFP against a SQL Server table you do get a row
> with null in your return cursor. So VFP9 is consistent with SQL Server.
> -Anders
>
> "HerbertDB" <herbertdb@nospam.com> wrote in message
> news:%23Rs7MCcdHHA.4516@TK2MSFTNGP04.phx.gbl...
>> Just read What New in VFP9. Its a new feature.
>>
>>
>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>> news:eXCKTqbdHHA.1080@TK2MSFTNGP02.phx.gbl...
>>> Hi,
>>>
>>> I have a SQL command in VFP8
>>>
>>> Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor
>>> tHistory
>>>
>>> If there is no Employee that matches lcEmpCode,
>>> the command returns a cursor with 0 records.
>>>
>>> I used the same command in VFP9 and it returned a cursor
>>> with one record with a NULL value. Is this correct?
>>>
>>>
>>> Thanks,
>>> Herbert
>>>
>>>
>>
>>
>
>



Re: Select Sum(nField) by HerbertDB

HerbertDB
Wed Apr 04 02:33:15 CDT 2007

Now I have to check if the result is NULL so I dont
have to add the result to my variable.


"HerbertDB" <herbertdb@nospam.com> wrote in message
news:uz$t8UodHHA.4872@TK2MSFTNGP03.phx.gbl...
> Can this feature be disabled? Most of my queries I add the
> result to a variable. Since VFP9 returns Null instead on no record,
> my variable now becomes NULL or 0.
>
>
> "Anders Altberg" <anders.altberg> wrote in message
> news:OiVXaHfdHHA.4964@TK2MSFTNGP04.phx.gbl...
>> If you do the same from VFP against a SQL Server table you do get a row
>> with null in your return cursor. So VFP9 is consistent with SQL Server.
>> -Anders
>>
>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>> news:%23Rs7MCcdHHA.4516@TK2MSFTNGP04.phx.gbl...
>>> Just read What New in VFP9. Its a new feature.
>>>
>>>
>>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>>> news:eXCKTqbdHHA.1080@TK2MSFTNGP02.phx.gbl...
>>>> Hi,
>>>>
>>>> I have a SQL command in VFP8
>>>>
>>>> Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor
>>>> tHistory
>>>>
>>>> If there is no Employee that matches lcEmpCode,
>>>> the command returns a cursor with 0 records.
>>>>
>>>> I used the same command in VFP9 and it returned a cursor
>>>> with one record with a NULL value. Is this correct?
>>>>
>>>>
>>>> Thanks,
>>>> Herbert
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Select Sum(nField) by HerbertDB

HerbertDB
Wed Apr 04 02:43:04 CDT 2007

Got it, SET ENGINEBEHAVIOR.


"HerbertDB" <herbertdb@nospam.com> wrote in message
news:uz$t8UodHHA.4872@TK2MSFTNGP03.phx.gbl...
> Can this feature be disabled? Most of my queries I add the
> result to a variable. Since VFP9 returns Null instead on no record,
> my variable now becomes NULL or 0.
>
>
> "Anders Altberg" <anders.altberg> wrote in message
> news:OiVXaHfdHHA.4964@TK2MSFTNGP04.phx.gbl...
>> If you do the same from VFP against a SQL Server table you do get a row
>> with null in your return cursor. So VFP9 is consistent with SQL Server.
>> -Anders
>>
>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>> news:%23Rs7MCcdHHA.4516@TK2MSFTNGP04.phx.gbl...
>>> Just read What New in VFP9. Its a new feature.
>>>
>>>
>>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>>> news:eXCKTqbdHHA.1080@TK2MSFTNGP02.phx.gbl...
>>>> Hi,
>>>>
>>>> I have a SQL command in VFP8
>>>>
>>>> Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor
>>>> tHistory
>>>>
>>>> If there is no Employee that matches lcEmpCode,
>>>> the command returns a cursor with 0 records.
>>>>
>>>> I used the same command in VFP9 and it returned a cursor
>>>> with one record with a NULL value. Is this correct?
>>>>
>>>>
>>>> Thanks,
>>>> Herbert
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Select Sum(nField) by Anders

Anders
Wed Apr 04 09:16:50 CDT 2007

SET ENGINEBEHAVIOR will cover up a number of non-standard SQL behaviors that
have been around for a long, too long, time.
Use Code references to spot the places that need changing. If this code was
in a class there
be a single place to change :).
-Anders

news:OJTzdsodHHA.588@TK2MSFTNGP06.phx.gbl...
> Got it, SET ENGINEBEHAVIOR.
>
>
> "HerbertDB" <herbertdb@nospam.com> wrote in message
> news:uz$t8UodHHA.4872@TK2MSFTNGP03.phx.gbl...
>> Can this feature be disabled? Most of my queries I add the
>> result to a variable. Since VFP9 returns Null instead on no record,
>> my variable now becomes NULL or 0.
>>
>>
>> "Anders Altberg" <anders.altberg> wrote in message
>> news:OiVXaHfdHHA.4964@TK2MSFTNGP04.phx.gbl...
>>> If you do the same from VFP against a SQL Server table you do get a row
>>> with null in your return cursor. So VFP9 is consistent with SQL Server.
>>> -Anders
>>>
>>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>>> news:%23Rs7MCcdHHA.4516@TK2MSFTNGP04.phx.gbl...
>>>> Just read What New in VFP9. Its a new feature.
>>>>
>>>>
>>>> "HerbertDB" <herbertdb@nospam.com> wrote in message
>>>> news:eXCKTqbdHHA.1080@TK2MSFTNGP02.phx.gbl...
>>>>> Hi,
>>>>>
>>>>> I have a SQL command in VFP8
>>>>>
>>>>> Sele Sum(nField) from History where cEmpCode=lcEmpCode Into Cursor
>>>>> tHistory
>>>>>
>>>>> If there is no Employee that matches lcEmpCode,
>>>>> the command returns a cursor with 0 records.
>>>>>
>>>>> I used the same command in VFP9 and it returned a cursor
>>>>> with one record with a NULL value. Is this correct?
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Herbert
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>