sqlite3 is chopping/cutting/truncating my text columns

Viewed 14528

I have values being cut off and would like to display the full values.

Sqlite3 -column -header locations.dbs "
select n.namelist, f.state, t.state
from names n
left join locations l on l.id = n.id
left join statenames f on f.st = l.st
left join statenames t on t.st = l.stto
where n.timing > 200601 and count(n.timing)<=15"

Which gives me

name        From State   To State  
----------  -----------  ----------
Jack        Connecticut  Louisiana 
Jeff Danie  New Hampshi  New Hampsh

The names are being truncated down to 10 characters or the length of the first row of data, whichever is longer. How can I stop this from happening without making the columns larger than they have to be?

Thanks

5 Answers

Here is another way to format several tables and show the rowid in a nice format.

#/usr/bin/env bash

cli_opts="-header"

for table in "table1" "table2"; do
    select="select rowid as ' ', * from $table;"
    #echo "$select"
    echo "$table"
    sqlite3 $cli_opts database.db "$select" | column -t -s "|"
    echo -e '\n'
done
Related