Re: Empty strings on Informix, using Centura
Posted in 1997
} From: infohos <infohos@unicall.be>
} To: informix-list@rmy.emory.edu
} Subject: Empty strings on Informix, using Centura
} Date: 24. oktsber 1997 12:29
}
} EMPTY STRINGS ON INFORMIX
} -------------------------
} Centura 1.1.1
} NT-Client 4.0
} Informix On-Line 7.22C1
} Windows NT 3.51
}
}
} On Informix, If you try to insert an empty string into a char field
} in the database (eg. CHAR(5)), a space is inserted into the database.
}
} If a user wants to update that record using a form developed in
} Centura 1.1.1 that space is displayed in the field.
}
} If the user wants to update that record, he has to remove that space
} before entering correct data into that field !!!
}
} Is there somebody who has the same problem ?
} Please send me a solution.
yes, we do...
our solution is function Empty2Null, which examine each parameter and
variables
containing empty string replaces with NULL
e.g.
SqlPrepareAndExecute( hSql, '
INSERT INTO tab
(c1,c2,c3,c4) VALUES
( ' || Empty2Null( ':v1,: v2, :v3, :v4') || ')'
HTH
ado
Adrian Simo tel. ++421-7-5384315
SWH spol s r.o. E-mail: Adrian.Simo@swh.sk
Stromova 9, 842 37 Bratislava, Slovakia