Subject | Re: [IBO] Field value |
---|---|
Author | Helen Borrie |
Post date | 2003-10-17T00:15:17Z |
At 11:08 PM 16/10/2003 +0000, you wrote:
you didn't need to do at all)
DestinationTablePHONE_NO.Clear;
string and NULL are different things. Empty string is "a string value of
zero length". NULL is a STATE in which the field has no value. You can't
treat it as a string because it isn't a string - it isn't anything.
Helen
>if is a bug of ibo, i dont knowSourceTablePHONE_NO.Clear;
>the sampel code his hier
>
> //DestinationTable: TIBOTable;
> //Database1: TIBODatabase;
> //SourceTable: TIBOTable;
> SourceTable.active:=true;
> SourceTable.first;
> SourceTable.edit;
>// SourceTablePHONE_NO.asvariant:=null;
>// set null to colunm phone_NO for test
> // ///////////////SourceTable.Post; don't post anythingDestinationTableHEAD_DEPT.Clear;
> // add record from sourcetable into destinationtable with field
>phonenumber = null
> destinationtable.insert;
> DestinationTableDEPT_NO.value :='950';
> DestinationTableDEPARTMENT.value :='Customer Support 1';
>// DestinationTableHEAD_DEPT.AsVariant:=NULL;
> DestinationTableMNGR_NO.value :=SourceTableMNGR_NO.value;Not valid, because you already cleared SourceTablePHONE_NO to null (which
> DestinationTableBUDGET.value :=SourceTableBUDGET.value;
> DestinationTableLOCATION.value :=SourceTableLOCATION.value;
> // use de property .text for demonstrate the problem
> // DestinationTablePHONE_NO.Text :=SourceTablePHONE_NO.Text;
you didn't need to do at all)
DestinationTablePHONE_NO.Clear;
> destinationtable.Post;Probably you need to understand NULL. It means "no value". So empty
> if DestinationTablePHONE_NO.isnull then
> showmessage('hello world')
> else
> showmessage('wrong?');
> // after this while, see column Phone_NO in iboconsole, the value
>is '' (empty string) but this correct is Null
> // (or <null> in a data grid of iboconsole
string and NULL are different things. Empty string is "a string value of
zero length". NULL is a STATE in which the field has no value. You can't
treat it as a string because it isn't a string - it isn't anything.
Helen