comparison OrthancServer/DatabaseWrapperBase.cpp @ 1761:f4286d99ee0a db-changes

fix sample database plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Oct 2015 11:22:48 +0100
parents 51db4a25a741
children b1291df2f780
comparison
equal deleted inserted replaced
1760:51db4a25a741 1761:f4286d99ee0a
693 693
694 std::auto_ptr<SQLite::Statement> s; 694 std::auto_ptr<SQLite::Statement> s;
695 695
696 switch (type) 696 switch (type)
697 { 697 {
698 case IdentifierConstraintType_Equal:
699 s.reset(new SQLite::Statement(db_, std::string(COMMON) + "d.value=?"));
700 break;
701
702 case IdentifierConstraintType_GreaterOrEqual: 698 case IdentifierConstraintType_GreaterOrEqual:
703 s.reset(new SQLite::Statement(db_, std::string(COMMON) + "d.value>=?")); 699 s.reset(new SQLite::Statement(db_, std::string(COMMON) + "d.value>=?"));
704 break; 700 break;
705 701
706 case IdentifierConstraintType_SmallerOrEqual: 702 case IdentifierConstraintType_SmallerOrEqual:
709 705
710 case IdentifierConstraintType_Wildcard: 706 case IdentifierConstraintType_Wildcard:
711 s.reset(new SQLite::Statement(db_, std::string(COMMON) + "d.value GLOB ?")); 707 s.reset(new SQLite::Statement(db_, std::string(COMMON) + "d.value GLOB ?"));
712 break; 708 break;
713 709
710 case IdentifierConstraintType_Equal:
714 default: 711 default:
715 throw OrthancException(ErrorCode_ParameterOutOfRange); 712 s.reset(new SQLite::Statement(db_, std::string(COMMON) + "d.value=?"));
713 break;
716 } 714 }
717 715
718 assert(s.get() != NULL); 716 assert(s.get() != NULL);
719 717
720 s->BindInt(0, level); 718 s->BindInt(0, level);