Giter VIP home page Giter VIP logo

Comments (6)

cuijianzhi avatar cuijianzhi commented on September 23, 2024 1

我的问题原因在于 Cursor cursor = db.query(DBConstants.TABLENAME, null, "netid=?"+netid,
null, null, null, null);

不应该将条件直接拼接
换成: Cursor cursor = db.query(DBConstants.TABLENAME, null, "netid=?",
new String[] { netNoteId }, null, null, null);
ok 完美解决!!!

from sqlcipher.

student-like avatar student-like commented on September 23, 2024 1

The answer from cuijianzhi actually worked for me haha, first I was trying to query my data using:

Cursor cursor = db.rawQuery("SELECT " + choice + " FROM consumption WHERE day = ?" dayTime ,null);

where dayTime (is a String) was something like "03052016". Like bigmickyg i got the error "variable number must be between ?1 and ?999". Now after creating a new String or whatever new String[] { dayTime } is doing, it finally worked 💃

Cursor cursor = db.rawQuery("SELECT " + choice + " FROM consumption WHERE day = ?",new String[] { dayTime } ,null);

from sqlcipher.

sjlombardo avatar sjlombardo commented on September 23, 2024

Hello Michael,

The error you are seeing is coming back from the parser, there is no inherent limitation on the primary keys size or inclusion of large numbers in queries. Most likely there is something wrong with the query you are using that is causing the large number to be interpreted as a bind parameter, see below.

https://www.sqlite.org/lang_expr.html#varparam

If you send over the exact code and query you are using we could take a look.

from sqlcipher.

bigmickyg avatar bigmickyg commented on September 23, 2024

Hello,

Thanks for the prompt reply.

For the moment we've worked around it by including the number directly in the query rather than in the whereArgs parameter.

We will review our query. It's very long and rather complicated - so we'll have a look first.

Regards,

Michael

from sqlcipher.

sjlombardo avatar sjlombardo commented on September 23, 2024

Michael,

Excellent, sounds good. I'm going to close this ticket for now, but please feel free to re-open or comment again at a later date.

Cheers,
Stephen

from sqlcipher.

developernotes avatar developernotes commented on September 23, 2024

Hello cuijianzhi,

I am not sure that I follow what you are saying above, please feel free to ask questions regarding SQLCipher on our mailing list, or you can create a new issue here if you are reporting a problem. Thanks!

from sqlcipher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.