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 7998183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:08:59+00:00 2026-06-04T15:08:59+00:00

I have 3 SQLite tables. Each has an ID as primary key; if I

  • 0

I have 3 SQLite tables. Each has an ID as primary key; if I provide a NULL when inserting a record to ID, it will auto-increment the key (at least that’s what the SQLite docs say). I am trying to get the NULL into this insert statement, but it crashes (‘NSInvalidArgumentException’, reason: ‘* -[NSPlaceholderString initWithFormat:locale:arguments:]: nil argument’
). Here is a snippet of the statement (dbCmd is defined as NSString):

        dbCmd = @"INSERT INTO CustData (ID, BUS_NAME, EMAIL, PHONE, SHOP_NAME, SHOP_ADDR1, SHOP_ADDR2, SHOP_CITY_STATE, SHOP_ZIP, "
    "SHIP_NAME, SHIP_ADDR1, SHIP_ADDR2, SHIP_CITY_STATE, SHIP_ZIP, SALES_NAME, NOTES) VALUES('";
    dbCmd = [dbCmd stringByAppendingFormat:NULL];  //  <--------------------
    dbCmd = [dbCmd stringByAppendingString: [methodParameters objectForKey: @"businessName"]];
    dbCmd = [dbCmd stringByAppendingString: @"', '"];
    dbCmd = [dbCmd stringByAppendingString: [methodParameters objectForKey: @"email"]];

How do I fix this?

  • 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-06-04T15:09:01+00:00Added an answer on June 4, 2026 at 3:09 pm

    From the sqlite docs:

    If no ROWID is specified on the insert, or if the specified ROWID has a value of NULL, then an appropriate ROWID is created automatically.

    http://www.sqlite.org/autoinc.html

    If you have no specific reason to specify the ID, you can simply leave it out!

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

Sidebar

Related Questions

I have a SQLite DB containing tasks. Each task has a date, and there
I have a relational database with about 100 tables. Each table has unique, numerical,
I have an SQLite database. I created the tables and filled them with a
I have two tables in a SQLite DB, and both have the following fields:
I have a table in SQLite database of Android which has a column RANK
I have an SQLite database with a simple table of Persons. Each row represents
I have 2 tables in a DB. Table2 has values that would be needed
I have an sqlite database used to store information about backup jobs. Each run,
I have a text file with rows (lines). Each row is a record in
Suppose I have a table nodes where I store a tree. Each node has

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.