1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] SQL Sqlalchemy Auto-increment of Primary key didnot work

Discussão em 'Outras Linguagens' iniciado por Stack, Agosto 31, 2021.

  1. Stack

    Stack Membro Participativo

    when I ran desc features

    +-------+--------------+------+-----+---------+----------------+
    | Field | Type | Null | Key | Default | Extra |
    +-------+--------------+------+-----+---------+----------------+
    | id | int(11) | NO | PRI | NULL | auto_increment |
    | name | varchar(128) | YES | UNI | NULL | |
    +-------+--------------+------+-----+---------+----------------+


    I have table like below,

    +-----------+----------------------------------------------------------+
    | id | name |
    +-----------+----------------------------------------------------------+
    | 105314659 | latitude |
    | 105314658 | final |
    +-----------+----------------------------------------------------------+


    I ran INSERT INTO features (name) VALUES ('test'), it didnot give auto-increment primary key, like

    +-----------+----------------------------------------------------------+
    | id | name |
    +-----------+----------------------------------------------------------+
    | 109728684 | test |
    | 105314659 | latitude |
    | 105314658 | final |
    +-----------+----------------------------------------------------------+


    +-----------+----------------------------------------------------------+
    | id | name |
    +-----------+----------------------------------------------------------+
    | 109728690 | test5 |
    | 109728688 | test4 |
    | 109728687 | test3 |
    | 109728686 | test2 |
    | 109728684 | test |
    | 105314659 | latitude |
    | 105314658 | final |
    +-----------+----------------------------------------------------------+


    anyone has any thoughts ? Thanks !

    *** This table I constant delete and insert BTW. But when I ran single insert, it didnot auto incremental id ***

    Continue reading...

Compartilhe esta Página