Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:55:41+00:00 2026-05-22T14:55:41+00:00

The count returns a count of the parameters and is good. However the index

  • 0

The count returns a count of the parameters and is good. However the index is returning 0.
Any ideas?

sqlite3 *database;
sqlite3_stmt *updateStmt;
int ID;
const char *sql;

sql = "update User set Name = ? , Dev = ?,ActiveLevel = ? Where _id = ?";


if(sqlite3_prepare_v2(database, sql, -1, &updateStmt, NULL) != SQLITE_OK)
  NSAssert1(0, @"Error while creating update statement. '%s'", sqlite3_errmsg(database));

NSLog(@"count %d",sqlite3_bind_parameter_count(updateStmt));

NSLog(@"Index %d",sqlite3_bind_parameter_index(updateStmt,"ActiveLevel"));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:55:41+00:00Added an answer on May 22, 2026 at 2:55 pm

    From the fine manual:

    int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
    Return the index of an SQL parameter given its name.

    And for parameters:

    ?
    A question mark that is not followed by a number creates a parameter with a number one greater than the largest parameter number already assigned.
    …
    :AAAA
    A colon followed by an identifier name holds a spot for a named parameter with the name :AAAA.

    Emphasis mine in the second section.

    Your SQL doesn’t have any named parameters at all, you just have plain old placeholders. The parameter name is the name of the placeholder (:AAAA), not the name of the column in question; remember that you can use placeholders in places where no name could be automatically derived so you have to name them yourself.

    If you want to use ActiveLevel as a named parameter, then your SQL should look like this:

    update User set Name = ? , Dev = ?, ActiveLevel = :ActiveLevel Where _id = ?
    

    And you’d probably want to replace the other placeholders (?) with named parameters for consistency.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context (doc count) ------------------------- clojure.core/count ([coll]) Returns the number of items in the collection.
I have a query which returns two rows of data as count. I want
I am using a library function called get_count_and_price which returns a 2-tuple (count,price). In
When I try to find out the total count of delicious bookmarks, Delicious returns
Consider the following code sample: interface IData { int Count(); } interface IOperations {
I am writing a function that returns a table. There are two parameters that
In the GenericUDAFCount.java: @Description(name = count, value = _FUNC_(*) - Returns the total number
Iam calling a PHP custom function with different parameters which returns a different arrays
I have an existing stored procedure that takes 2 parameters and returns back an
I'm using output parameters to get values from my database. This is my stored

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.