sqlite3 is chopping/cutting/truncating my text columns
There doesn't appear to be a way to make it automatic, but you can use the .width
command to manually specify the column widths.
See here (search the section for .width
).
SQLite3 Terminal Output Formatting .width
The sqlite3
tool has no such function.
You would have to compute the column widths by hand (SELECT max(length(col1)) ...
).
How to format column width in SQLite3 using python?
Turns out that pandas was the limiting factor and not sqlite3. I solved this issue by manually setting pd.options.display.max_colwidth
to 255
.
The single line that solved this:
pd.options.display.max_colwidth = 255
Why is GWT ArrayList of String objects truncating text with an ampersand?
Well, it turns out it was an interaction between my History Manager and the DataStore class. A very strange situation that no one could have helped me with given the limited amount of information I had provided.
Some SQL data in Russian is outputted with symbol � at the end
It sounds like a simple truncation problem. Varchar(150) says field is maximum 150 bytes. UTF8 can use more than one byte per symbol - for example, each letter in cyrillic will use 2 bytes, while space or comma symbols will use 1 byte. So if the string is more than 150 bytes long, it's possible that the cyrillic letter is truncated in the middle. For example, in your second sentence, small и
has utf8 code d0 b8
, but was truncated to d0
which is non-printable symbol, resulting in ?
s you see. Nothing you can do about it, the data is already lost. You can only prettify the display by removing standalone byte in the range of C2..DF
from the end of the string.
As for unidentified letters you see, there's a lot of factors. Database encoding, connection encoding, table collation and display encoding if you're using a web interface all contribute to the mess, there might be multiple re-encodings to the string before you see it. It's also possible that the data is recoded in some way on insert and decoded before display - not the worst thing I saw in legacy code, really. You'll have to experiment and find the proper combination yourself.
Related Topics
PHP Is Truncating Mssql Blob Data (4096B), Even After Setting Ini Values. am I Missing One
Exporting Binary File Data (Images) from SQL via a Stored Procedure
How to Use a Trim Function in SQL Server
How to Insert Data to SQL Server Table Using R
Is Count(*) in SQL Server a Constant Time Operation? If Not, Why Not
Oracle SQL: Understanding the Behavior of Sys_Guid() When Present in an Inline View
How to Use Group by Based on a Case Statement in Oracle
Why Can't You Use Sqlite Rowid as a Primary Key
What Is The SQL Used to Do a Search Similar to "Related Questions" on Stackoverflow
How to Use MySQL Index Columns
How to Find Out If an Oracle Database Is Set to Autocommit
Oracle Pls-00363: Expression '' Cannot Be Used as an Assignment Target
Can You Replace or Update a SQL Constraint
How to Select a Fixed Number of Rows for Each Group