cyoubo / spatialite-android

Automatically exported from code.google.com/p/spatialite-android
0 stars 0 forks source link

implement Stmt.value() or add Callback argument to Stmt.step() #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use prepared statements, 
2. bind values
3. execute step()
4. Try to get values returned by query

What is the expected output? What do you see instead?
either function stmt.value(1) 
or possibility to add Callback just like for exec(...)

What version of the product are you using? On what operating system?
r20, Linux

Original issue reported on code.google.com by mateuszz...@gmail.com on 13 Mar 2012 at 12:28

GoogleCodeExporter commented 9 years ago
See: http://sqlite.org/c3ref/step.html for information about what step does.

If you want to print the results you can do the following:
stmt = db.prepare(...);
stmt.bind(...);
while (stmt.step()) {
  System.out.println(stmt.column_string(0));
}

Take a look at the unit tests.  BTW, I just switched the repo to a GIT 
repository.

Original comment by efroh...@gmail.com on 13 Mar 2012 at 1:19

GoogleCodeExporter commented 9 years ago
Ok, seems I missed this function, sorry. It's my first time coding something 
with SQLite.

Could You then change javadoc for Stmt.prepare(..):
     *       while (s.step(cb)) {
     *         Object o = s.value(...);
     *         ...
     *       }
to reflect real function name?:
     *       while (s.step(cb)) {
     *         Object o = s.column_xxx(...);
     *         ...
     *       }
Current one mislead me. If someone has similar problem to me, It will be far 
easier to find.

Original comment by mateuszz...@gmail.com on 13 Mar 2012 at 1:50

GoogleCodeExporter commented 9 years ago
Looks like the documentation is out of date.  I actually use the Java Sqlite 
Wrapper found at http://www.ch-werner.de/javasqlite/.  If you are interested in 
contributing a update I would email the author of the project with a update. If 
you CC me with the changes I will include them in my project too.

Original comment by efroh...@gmail.com on 14 Mar 2012 at 12:39