Recent

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

nugax

  • Jr. Member
  • **
  • Posts: 86
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

  • Full Member
  • ***
  • Posts: 207
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 1.6 FPC 3.0.0 Linux Mint Mate 17.2 x86_64 GTK-2
Zeos 7.1.3 - Sqlite 3.8.2

Foro Lazarus en español http://forum.lazarus.freepascal.org/index.php/board,73.0.html