X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdbms%2Ffunctions.cpp;fp=source%2Fdbms%2Ffunctions.cpp;h=0000000000000000000000000000000000000000;hb=a3b95648bd76140ef55e0b5941d423eee6c3856f;hp=97a4e88e57ddf1f1ded133e772e57da1194c8443;hpb=94fc4366adedbf26ca6ef3104f88d41fa85f5a72;p=anna.git diff --git a/source/dbms/functions.cpp b/source/dbms/functions.cpp deleted file mode 100644 index 97a4e88..0000000 --- a/source/dbms/functions.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// ANNA - Anna is Not Nothingness Anymore // -// // -// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // -// // -// See project site at http://redmine.teslayout.com/projects/anna-suite // -// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // - - -#include - -#include -#include -#include -#include -#include - -using namespace std; -using namespace anna; - -/*static*/ -void dbms::functions::verifyDataScheme(dbms::Connection& connection, const char* tableName, const char* requiredPatch, const char* columnID, const char* columnDate) -throw(RuntimeException) { - dbms::Database& database = connection.getDatabase(); - dbms::Statement* statement = NULL; - dbms::String id(8); - string sql = anna::functions::asString( - "select max(%s) from %s where %s in (select max(%s) from %s)", - columnID, tableName, columnDate, - columnDate, tableName - ); - - try { - statement = database.createStatement("dbms::functions::VerifyDataScheme", sql); - statement->bindOutput("max_id", id); - dbms::ResultCode resultCode = connection.execute(statement); - - if(resultCode.successful() == false) - throw dbms::DatabaseException(resultCode, ANNA_FILE_LOCATION); - - statement->fetch(); - const string _id(id.getValue()); - const string _required(requiredPatch); - - if(_required != _id) { - std::string msg("DataScheme is out of date | Current patch: "); - msg += id; - msg += " | Required patch: "; - msg += requiredPatch; - throw RuntimeException(msg, ANNA_FILE_LOCATION); - } - - database.releaseStatement(statement); - } catch(dbms::DatabaseException& edb) { - database.releaseStatement(statement); - throw RuntimeException(edb); - } catch(RuntimeException&) { - database.releaseStatement(statement); - throw; - } -}