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.

-----Urspr?ngliche Nachricht-----
Von: J Decker [mailto:d3ck0r at gmail.com]
Gesendet: Montag, 01. Juni 2015 20:48
An: General Discussion of SQLite Database
Betreff: Re: [sqlite] How to get length of all columns in a table

you get the length in the result set?

sqlite3_column_bytes( statement, idx );

On Mon, Jun 1, 2015 at 10:28 AM, Drago, William @ CSG - NARDA-MITEQ < 
William.Drago at l-3com.com> wrote:

> > -----Original Message-----
> > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-
> > users-bounces at mailinglists.sqlite.org] On Behalf Of Simon Slavin
> > Sent: Monday, June 01, 2015 12:59 PM
> > To: General Discussion of SQLite Database
> > Subject: Re: [sqlite] How to get length of all columns in a table
> >
> >
> > On 1 Jun 2015, at 4:45pm, Drago, William @ CSG - NARDA-MITEQ
> > <William.Drago at L-3com.com> wrote:
> >
> > Just to confirm, the following is the only practical way to get the
> > length of each column in a table:
> > >
> > > Select Length(col_1)
> > > ,Length(col_2)
> > > ,Length(col_3)
> > > .
> > > .
> > > .
> > > ,Length(col_n)
> >
> > Martin's other answer will probably give you the answer faster:
> >
> > SELECT length(col_1||col2||col_3 ... col_n) FROM MyTable
>
> That returns the sum of the column lengths. I was looking for the
> length of each individual column.
>
> Thanks anyway,
>
> -Bill
> 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.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


Reply via email to