diff --git a/rdbms/OcciStmt.cpp b/rdbms/OcciStmt.cpp
index 46e502d00d8c6dd6621b4cbe07417cd65ef12dc6..caab6da43def77b7e21d9db58c512ffcab883679 100644
--- a/rdbms/OcciStmt.cpp
+++ b/rdbms/OcciStmt.cpp
@@ -59,11 +59,12 @@ OcciStmt::OcciStmt(
     }
   } catch(exception::Exception &ex) {
     close();
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + sql + ": " +
-      ex.getMessage().str());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      sql.substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str());
   } catch(std::exception &se) {
     close();
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + sql + ": " + se.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      sql.substr(0, c_maxSqlLenInExceptions) + ": " + se.what());
   }
 }
 
@@ -90,10 +91,11 @@ void OcciStmt::close() {
       m_stmt = nullptr;
     }
   } catch(exception::Exception &ex) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
-                               ex.getMessage().str());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str());
   } catch(std::exception &se) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " + se.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + se.what());
   }
 }
 
@@ -128,10 +130,11 @@ void OcciStmt::bindOptionalUint64(const std::string &paramName, const optional<u
       m_stmt->setNull(paramIdx, oracle::occi::OCCINUMBER);
     }
   } catch(exception::Exception &ex) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
-      ex.getMessage().str());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str());
   } catch(std::exception &se) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " + se.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + se.what());
   }
 }
 
@@ -163,10 +166,11 @@ void OcciStmt::bindOptionalString(const std::string &paramName, const optional<s
       m_stmt->setNull(paramIdx, oracle::occi::OCCISTRING);
     }
   } catch(exception::Exception &ex) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
-      ex.getMessage().str());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str());
   } catch(std::exception &se) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " + se.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + se.what());
   }
 }
 
@@ -191,7 +195,8 @@ std::unique_ptr<Rset> OcciStmt::executeQuery() {
       } catch(...) {
       }
     }
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " + ex.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.what());
   }
 }
 
@@ -216,7 +221,8 @@ void OcciStmt::executeNonQuery() {
       } catch(...) {
       }
     }
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " + ex.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.what());
   }
 }
 
diff --git a/rdbms/SqliteStmt.cpp b/rdbms/SqliteStmt.cpp
index 44b81a74be8b6829af51365adcf77a553ec0b815..063643b10ffb9853c9bf8aae54e25fd87b9253ae 100644
--- a/rdbms/SqliteStmt.cpp
+++ b/rdbms/SqliteStmt.cpp
@@ -94,11 +94,12 @@ SqliteStmt::SqliteStmt(
     }
   } catch(exception::Exception &ex) {
     close();
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + sql + ": " +
-      ex.getMessage().str());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      sql.substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str());
   } catch(std::exception &se) {
     close();
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + sql + ": " + se.what());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      sql.substr(0, c_maxSqlLenInExceptions) + ": " + se.what());
   }
 }
 
@@ -130,8 +131,8 @@ void SqliteStmt::close() {
 //------------------------------------------------------------------------------
 sqlite3_stmt *SqliteStmt::get() const {
   if(nullptr == m_stmt) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() +
-      ": nullptr pointer");
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": nullptr pointer");
   }
   return m_stmt;
 }
@@ -170,8 +171,8 @@ void SqliteStmt::bindOptionalUint64(const std::string &paramName, const optional
       throw exception::Exception("sqlite3_bind_int64() failed");
     }
   } catch(exception::Exception &ex) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
-      ex.getMessage().str());
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str());
   }
 }
 
@@ -206,8 +207,8 @@ void SqliteStmt::bindOptionalString(const std::string &paramName, const optional
       throw exception::Exception("sqlite3_bind_text() failed");
     }
   } catch(exception::Exception &ex) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
-      ex.getMessage().str()); 
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + ex.getMessage().str()); 
   }
 }
 
@@ -228,16 +229,16 @@ void SqliteStmt::executeNonQuery() {
 
   // Throw an exception if the call to sqlite3_step() failed
   if(SQLITE_DONE != stepRc && SQLITE_ROW != stepRc) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() + ": " +
-      Sqlite::rcToStr(stepRc));
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": " + Sqlite::rcToStr(stepRc));
   }
 
   m_nbAffectedRows = sqlite3_changes(m_conn.m_sqliteConn);
 
   // Throw an exception if the SQL statement returned a result set
   if(SQLITE_ROW == stepRc) {
-    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " + getSql() +
-      ": The SQL statment returned a result set");
+    throw exception::Exception(std::string(__FUNCTION__) + " failed for SQL statement " +
+      getSql().substr(0, c_maxSqlLenInExceptions) + ": The SQL statment returned a result set");
   }
 }
 
diff --git a/rdbms/Stmt.hpp b/rdbms/Stmt.hpp
index 8796d7221c1b5e869f380ce5aa397736d5e0c48d..15dce6e9508f958c287052dafe807e65cd11d268 100644
--- a/rdbms/Stmt.hpp
+++ b/rdbms/Stmt.hpp
@@ -177,6 +177,11 @@ protected:
    */
   AutocommitMode m_autoCommitMode;
 
+  /**
+   * The maximum length an SQL statement can have in exception error message.
+   */
+  const uint32_t c_maxSqlLenInExceptions = 80;
+
 }; // class Stmt
 
 } // namespace rdbms