Recent

Author Topic: Code For Sqlite3 Question  (Read 1686 times)

nugax

  • Full Member
  • ***
  • Posts: 232
Code For Sqlite3 Question
« on: January 10, 2019, 08:17:32 pm »
Can someone give me the sql statement pascal uses to enter an auto incremented field?

example:
assume field id is auto-increment

INSERT INTO table (col1, col2) VALUES ("1", "2");

I want field id auto incremented, then 1,2 in the respective col

I tried this and get errors.
-Nugax

GAN

  • Sr. Member
  • ****
  • Posts: 370
Re: Code For Sqlite3 Question
« Reply #1 on: January 10, 2019, 09:29:49 pm »
Just ignore the autoincrement column. For example: col1 is autoincrement, col2 varchar and col3 integer, then:

INSERT INTO table1 (col2, col3) VALUES ('Pascal', 3);

Lazarus 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

 

TinyPortal © 2005-2018