Re: lvarchar question.
Posted in 2003
Andrew Hardy wrote: > Can I only add printable characters to an lvarchar or can I add a string of > bytes, each byte being in the value range 0..255. Yes. > If I can do this, how would I do it. Use the functions from the ESQL/C manual which manipulate the LVARCHAR data structures in your C program. Basically, find the function(s) which allow you to specify a pointer to the data and a byte count. I could bash the manual for you, but then you'd be deprived of the learning experience. > For example I want a string where the first byte had the value 5 and the > subsequent 5 bytes had the values 104, 101, 108, 108, 111 ("hello"). > > If this is possible, then would byte string be correctly ordered if > indexed, ie on the first byte first (the 5), then the 104 etc... Can you create an index on an LVARCHAR? If so, it would work fine. If not, it won't. > Also would the data be retrievable from the database, or would this 5 get > converted to a space ? The character code '5' had better not be converted to space! > I hope this makes sense. Well, sort of - but why do you want to do the byte counts yourself? Why not let the DBMS do it for you? (That is, I don't see why you would want to store the byte count yourself - why not just store the 5 operational bytes?) -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/