Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setting dw element to null

386 views
Skip to first unread message

Todd

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
How do I set a datawindow element to null? Here is what I want to do, but
it gives me "type mismatch error":

int num
SetNull(num)
dw_1.object.score[3] = num

I've also tried this with no success:

SetNull(dw_1.object.score[3])

Thanks.


Lu Powell

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
Try using SetItem() rather than direct expressions:

integer li_num
SetNull ( li_num )
dw_1.SetItem ( 3, "score", li_num )


Todd <wha...@mciworld.com> wrote in message
news:5htrNQw7#GA....@forums.sybase.com...

Philip Salgannik

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
...or try this:
any la_null
SetNull(la_null)
dw_1.object.score[3] = la_null

Lu Powell <lu.p...@worldnet.att.net> wrote in message
news:idmlCCx7#GA....@forums.sybase.com...

Todd

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
Philip's way gives "type mismatch" and Lu's way stores " " in the database
???

The field I'm updating is nullable in the database.


Philip Salgannik <phi...@msn.com> wrote in message
news:Df1#uRx7#GA....@forums.sybase.com...

Philip Salgannik

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
What type is score?
Looks like it is string. Then mark empty string is Null int he DW
Painter....

Todd <wha...@mciworld.com> wrote in message

news:JSrchHy7#GA....@forums.sybase.com...

Todd

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
Yes, score is a string. I tried setting "empty string is null" and it still
puts a " " space in the database. This is a single space, not an empty
string.

Philip Salgannik <phi...@msn.com> wrote in message

news:8jL7Gcy7#GA....@forums.sybase.com...

Todd

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
I finally got it to save a null by using:

dw_1.SetColumn("score")
dw_1.Clear()

I don't know why it was saving a single space in there when I set it to an
empty string and had "empty string is null" set.

Thanks anyway.

Simon Caldwell

unread,
Aug 26, 1999, 3:00:00 AM8/26/99
to
If score is a string then why are you assigning an integer to it? The
solution is:

string ls_null
SetNull(ls_null)
dw_1.object.score[3] = ls_null

Simon

>
Todd wrote in message ...


>Yes, score is a string. I tried setting "empty string is null" and it
still
>puts a " " space in the database. This is a single space, not an empty
>string.
>

Ron Taylor

unread,
Aug 26, 1999, 3:00:00 AM8/26/99
to

Have you checked what the initial value is in Column Specifications?

0 new messages