[V4MD] Question about the SQLExecute Command

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Mar 14 21:07:33 CST 2003


on 3/14/03 8:25 PM, Carsten Ilwig at Carsten.Ilwig at portal-rind.de wrote:

>> if IsNULL (fldref) then
>>    return empty
>> else
>>   return GetField(fldRef)
>> end if
> Sorry, but I can agree with you. :-(
> 
> I tried following in Director:
> 
> --the flag = #nullable
> setField(myCursor,"DateField",VOID)
> put IsNull(myCursor,"DateField")
> -- 1
> put GetField(myCursor,"DateField")
> -- ""
> Fieldvalue in viSQL: NULL
> that's ok.
> 
> but now:
> setField(myCursor,"DateField","00.00.0000")
> put IsNull(myCursor,"DateField")
> -- 0
> put GetField(myCursor,"DateField")
> -- "00.00.2000"
> Fieldvalue in viSQL: "00.00.2000"
> 
> Now I changed the fieldflag
> --the flag = 0
> setField(myCursor,"DateField",VOID)
> put IsNull(myCursor,"DateField")
> -- 0
> put GetField(myCursor,"DateField")
> -- ""
> Fieldvalue in viSQL: "00.00.0000"
> that's ok.
> 
> but now:
> setField(myCursor,"DateField","00.00.0000")
> put IsNull(myCursor,"DateField")
> -- 0
> put GetField(myCursor,"DateField")
> -- "00.00.2000"
> Fieldvalue in viSQL: "00.00.2000"
> 
>> the display function auto-adds 2000 to a short year
> The examples above shows that this function not only auto-adds 2000 when I
> display the data.
> It looks like it adds 2000 when I set the fiedlvalue.
> And next, it adds not only to a short year.
> 
> Maybe thats all correct, so I have to make a workaround to check is the date
> a correct value or not.
> Because "00.00.2000" isn't a correct date value.

Carsten,


If you want make a field to be NULL, then you need to use

    SetNull( myCursor,"DateField" )

As I see you try to use for this syntax:

    setField(myCursor,"DateField",VOID)
    
This is not correct.

Cursor also have SetBlank() function which set to NULL all fields of cursor.
We usually need call this function before you start add fill fields for
adding of new record.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list