Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Custom db functions (extends tab_db_impl.cpp/.h)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "evl_db_impl_custom.h"
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/sql_query_janitor.h>
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace Evaluations
|
||||
{
|
||||
// custom procs, body must be implemented by user
|
||||
bool DatabaseInterfaceImplCustom::removeCategoryLinesPerNineLiner(qint64 nineLinerId)
|
||||
{
|
||||
const QString tableName = getTableName(QStringLiteral("san_category_line"));
|
||||
const QString stmt = QStringLiteral("DELETE FROM ") + tableName + QStringLiteral(" WHERE nine_liner_id = :id");
|
||||
|
||||
if (!m_query)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "m_query not initialized";
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
SqlQueryJanitor janitor(m_query);
|
||||
|
||||
if (!m_query->prepare(stmt))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not prepare statement: " << stmt;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_query->bindValue(QStringLiteral(":id"), nineLinerId);
|
||||
|
||||
if (!m_query->exec())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not execute statement: " << stmt;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} // query scope
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user