+ fprintf(stderr, "SQLite Error: %s\n", sqlite3_errmsg(Database));
+ fprintf(stderr, "query = \"%s\"\n", Query);
+ return NULL;
+ }
+
+ return ret;
+}
+
+/*
+ * Create a SQLite statement and query it for the first row
+ * Returns NULL if the the set is empty
+ */
+sqlite3_stmt *Bank_int_QuerySingle(sqlite3 *Database, const char *Query)
+{
+ sqlite3_stmt *ret;
+ int rv;
+
+ // Prepare query
+ ret = Bank_int_MakeStatemnt(Database, Query);
+ if( !statement ) return NULL;
+
+ // Get row
+ rv = sqlite3_step(statement);
+ // - Empty result set
+ if( rv == SQLITE_DONE ) return NULL;
+ // - Other error
+ if( rv != SQLITE_ROW ) {