All, I just want to make sure everyone understands that I know how to get the length of a column and that I was only asking for a wildcard technique to get the lengths of all columns in a table without having to list all the columns (e.g. SELECT Length(*) FROM myTable). Obviously that doesn't work, but that's the kind of thing I was looking for.
I already wrote a little code snippet to automatically generate a "SELECT Length(col_1), Length(col_2...)" string from the table def, and I'm happy with that solution. I am using this on BLOBs and Length() is returning the number of bytes, which is exactly what I need. All is well. Thanks for all your input, -- Bill Drago Senior Engineer L3 Narda-MITEQ 435 Moreland Road Hauppauge, NY 11788 631-272-5947 / William.Drago at L-3COM.com > -----Original Message----- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite- > users-bounces at mailinglists.sqlite.org] On Behalf Of Richard Hipp > Sent: Tuesday, June 02, 2015 9:15 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] How to get length of all columns in a table > > On 6/2/15, Igor Tandetnik <igor at tandetnik.org> wrote: > > On 6/2/2015 2:28 AM, Hick Gunter wrote: > >> Sqlite3_column_bytes will convert numeric values to strings and > >> return the length of that "string representation" (excluding the > >> terminating \0), not the byte size required to store the numeric > value itself. > > > > So will length() SQL function, I'm pretty sure. > > Yes, both length() and sqlite3_column_bytes() will convert numbers to > strings before computing the length. However, they are not equivalent. > > The length() SQL function returns the number of *characters*. The > sqlite3_column_bytes() C function returns the number of *bytes*. > > -- > D. Richard Hipp > drh at sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments.