I've seen a small patch along the lines of this used. I'm sure it could be improved, but it seems like it often would give a bit more context.
Token msg; msg.z = pParse->zTail; msg.n = pParse->sLastToken.z - pParse->zTail + pParse->sLastToken.n; if(msg.n > 36) { msg.z = msg.z + msg.n - 36; msg.n = 36; } assert( msg.z[0] ); sqlite3ErrorMsg(pParse, "near \"%T<--here\": syntax error", &msg); UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */ assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ /*sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);*/ -----Original Message----- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Paul Sanderson Sent: Saturday, March 19, 2016 6:27 AM To: General Discussion of SQLite Database Subject: [sqlite] error messages from SQLite When executing a sql query I often find I have made a typo or been a bit dull and I'll get an error message back along the lines of Error: near "text": syntax error Is there a way of expanding on this, for instance adding more of the following text or a character offset. The last time this happened I had a create table... command with about 30 text columns and identifying which "text" string the error referred to took a little while. Thanks _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message.