char_length() returns -1
Posted in 2005
Topics: Performance & Tuning, Data Types & Schema Design, Triggers, Constraints & Referential Integrity, Internationalization & Character Sets
Hi. I cannot find it documented anywhere what it means when the
function char_length() returns -1 .
We are working with IDS version 9.4 FC5 (on a Tru64 system).
I have a table called page_facts with the following columns
integer page_id,
lvarchar title(500)
CLIENT_LOCALE and DB_LOCALE are both set to "en_us.utf8"
if I run the following query:
select * from page_facts where char_length(title) = -1
I get several records returned. I have searched high and low for what
that "-1" means - I'm assuming it means that there is malformed utf-8
in the title column. In fact I saw one posting to this group where
somebody put a check constraint on a table that checked that the
char_length() of a varchar column was greater than 0. But I don't see
it documented anywhere what "-1" actually means.
BTW - is putting a constraint like that on my tables a good idea? What
would be the performance impact if the lvarchar column had a maximum
size of 25000 bytes (as one of my tables does).
Thank you advance,
Lou