[V4MD] Question about the SQLExecute Command
Carsten Ilwig
Carsten.Ilwig at Portal-RIND.de
Fri Mar 14 15:05:21 CST 2003
> Carsten, I may be wrong but i think that your field is set to null as
> expected but you are not handling the returned value correctly (the
> display function auto-adds 2000 to a short year which I think it is
> documented somewhere).
>
> In order to see what ViSQL shows you need sth like the following
pseudo-code
>
> 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
More information about the Valentina
mailing list