On Fri, Apr 23, 2010 at 10:42 AM, Derek Martin <demar...@akamai.com> wrote: > On Fri, Apr 23, 2010 at 08:52:37AM -0500, Jay A. Kreibich wrote: >> On Thu, Apr 22, 2010 at 06:31:07PM -0400, Derek Martin scratched on the wall: >> > Hi, >> > >> > I have a query that produces about 10 columns, some of which are very >> > wide. When I run sqlite3 with -column -header, it truncates all >> > fields to 10 characters. This makes the query absolutely useless. >> > How can I turn off this truncation? >> > >> > I already tried explicitly setting the width to 0, that did not help. >> >> Pick large enough values, or don't use column mode. > > Sadly that was the conclusion I had reached before asking here. > Needless to say, that was not the answer I was hoping for. > > Column mode (without any truncation) is the format desired for these > reports... Picking large enough values is bad, because it means that > I'd need to specify very large column widths for most of the columns, > which in many cases would needlessly make the report tediously wide, > to accomodate some less common cases where the reports generate very > wide columns. Avoiding this is sort of the point of databases doing > this for you... ;-)
Well, no... the job of a database is to store your data, and then hand it back to you as fast as possible without changing the data in anyway. A perfect and most minimal database will preserve your data integrity 100%. It will give you back whatever you put in, without any interpretation. A perfect database is like a perfect audio speaker -- the latter would not add treble or bass to your audio... it will reproduce the audio exactly as it was meant to be. On top of the above, sqlite is a very minimalist db library. sqlite3 shell is a c program that allows you to access your data stored in the sqlite db file via the sqlite db library. Think of the sqlite3 shell as a client program that the sqlite developer wrote to get to the sqlite db. All the formatting that you want to do, you can and should do via your client program. You can have a choice of many different languages to program one for yourself. Or you can probably even pay and purchase a few client programs that others have written. > > It would be swell if sqlite3 had a -notruncate option or some such, What version of sqlite are you using? Funnily, I have a table with lots of running text, and even though I specify .mode column, I don't see any truncation at all. Of course, the text wraps around in my terminal window and makes everything look like nonsense, but that is another story. > though adding one now wouldn't really solve my immediate problem, > since that wouldn't be available on our desktop image. With its > current behavior, column mode seems fairly worthless to me. I guess > I'll need to convince folks that HTML output is suitable, or that they > need to install some other database thingy to run this stuff. Using > sqlite3 for this seemed perfect, since it's already available to > everyone. >d The "database thingy" you need is a client program. You could try the one written in XUL, the Firefox add-on, which, while not very attractive, actually works quite well. It is also free as in both speech and beer, so you could probably modify it to suit your needs. > Thanks > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users