私はこれが古い質問だと知っていますが、あなたがJavaでコーディングしていて、この問題がある場合、これは参考になるかもしれません。同様のチェックを処理する関数を登録することができます。私は先端の形にこのポストを得た:sqliteのJDBCに私は依存https://stackoverflow.com/a/29831950/1271573
ソリューション:https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc
私の場合は、特定の文字列を別の文字列の一部として存在していたかどうかを確認するために必要な(%のMyString%」のような')ので、Contains関数を作成しましたが、これを拡張してregexなどを使用してよりSQL的なチェックを行うことは可能です。 MyColが含まれている場合はどうしたら「検索文字列」を参照してSQLの関数を使用するには
:あなたが最初に登録する必要があり、この機能を使用するには
public class Contains extends Function {
@Override
protected void xFunc() throws SQLException {
if (args() != 2) {
throw new SQLException("Contains(t1,t2): Invalid argument count. Requires 2, but found " + args());
}
String testValue = value_text(0).toLowerCase();
String isLike = value_text(1).toLowerCase();
if (testValue.contains(isLike)) {
result(1);
} else {
result(0);
}
}
}
:ここ
select * from mytable where Contains(MyCol, 'searchstring')
は私が関数が含まれていますそれ。あなたはそれを使用して完了したら、オプションでそれを破壊することができます。ここではどのようにある:
public static void registerContainsFunc(Connection con) throws SQLException {
Function.create(con, Contains.class.getSimpleName(), new Contains());
}
public static void destroyContainsFunc(Connection con) throws SQLException {
Function.destroy(con, Contains.class.getSimpleName());
}
http://stackoverflow.com/a/973777/1427878 – CBroe