android是SQLITE,语法和普通的SQL语句有些差别,你为啥不先 string sql=InNum(field0,field1);然后再把这个string 放到整个查询语句中,,,

解决方案 »

  1.   


    就像楼上说的那样,先用函数求值,再把值组合到SQL语句中去就好。
      

  2.   

    将InNum用java实现,然后将返回值放入sql里。
      

  3.   

    嗯.我的意思是这样的SQL语句:select * from db where InNum(字段1,字段2,100,120)=1
    也就是说,InNum函数实现的功能需要字段内容做参数...
      

  4.   

    http://www.cnblogs.com/imouto/archive/2013/06/14/how-to-add-user-defined-functions-for-sqlite.htmlhttp://stackoverflow.com/questions/7867099/how-to-create-a-user-defined-function-in-sqlite
      

  5.   

    在android的SQLiteDatabase里有个接口函数CustomFunction,如何使用这个接口函数?
    public final class SQLiteDatabase extends SQLiteClosable {
    //...其它代码
    /**
         * A callback interface for a custom sqlite3 function.
         * This can be used to create a function that can be called from
         * sqlite3 database triggers.
         * @hide
         */
        public interface CustomFunction {
            public void callback(String[] args);
        }
    }
      

  6.   

    这我看过.然后我试了一下"通过 Java 语言接口添加自定义函数",可惜程序报错.SQLiteDatabase没有addCustomFunction和CustomFunction成员函数.不知道怎么回事