Re: Better comparing and converting of variant values...?
From: Bjørge Sæther (bjorge_at_hahaha_itte.no)
Date: 04/29/04
- Previous message: Aaron Miles: "Impact of TSession"
- In reply to: pr: "Re: Better comparing and converting of variant values...?"
- Next in thread: Maarten Wiltink: "Re: Better comparing and converting of variant values...?"
- Reply: Maarten Wiltink: "Re: Better comparing and converting of variant values...?"
- Reply: pr: "Re: Better comparing and converting of variant values...?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 09:03:57 +0200
pr wrote:
> "Bjørge Sæther" <bjorge@hahaha_itte.no> wrote in message
> news:Khvjc.427$Yc.5982@news4.e.nsc.no...
>> You need to do a lot of checking before trying to compare or cast
>> variants. To my application, an 'Unassigned' variant should be
>> resulting in an empty string value, an empty string should equal an
>> unassigned, etc., etc.. The matrix is quite large then...
>
> An empty string is not an unassigned, it is an empty string!
> Unassigned means just that, no data type, no value.
> An unassigned may be considered an empty string in
> some implementations, but this is not the case in SQL.
Oracle stores and treats '' as NULL. Which, IMHO, is correct. For STRINGS,
that is. A Delphi string type doesn't distinguish between '' and NULL.
> Confuse the two at your own peril.
I don't *confuse* anything, I just said that I need a few code snippets that
returns values much like TField does, and that doesn't throw exceptions when
a string field is NULL - just gently return ''. As it is now, I need to do a
lot of checking all the time.
If anyone attending this group had made these routines (and would share
them), I'd have them by now. So - I'll have to do it myself....;-)
-- Regards, Bjørge Sæther bjorge@haha_itte.no ------------------------------------- I'll not spend any money on American Software products until armed forces are out of Iraq.
- Previous message: Aaron Miles: "Impact of TSession"
- In reply to: pr: "Re: Better comparing and converting of variant values...?"
- Next in thread: Maarten Wiltink: "Re: Better comparing and converting of variant values...?"
- Reply: Maarten Wiltink: "Re: Better comparing and converting of variant values...?"
- Reply: pr: "Re: Better comparing and converting of variant values...?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|