Error importing sqlite.sql

Error importing sqlite.sql

msoutopicomsoutopico Posts: 2Questions: 1Answers: 0

Hi there,

I have created a database test.sqlite3 in DB Browser for SQLite, then I tried to import file sqlite.sql that comes with the downloadable package Editor-PHP.1.7.0.zip. I get the following error:

Error importing data: Error in statement #23: not an error. Aborting execution and rolling back.

Do you know what is causing this error or what I should do to fix it? Thanks.

Cheers, Manuel

Answers

  • msoutopicomsoutopico Posts: 2Questions: 1Answers: 0

    I can see a few issues in the sql file.

    -- Expect only one dept per user
    CREATE TABLE user_dept (
        user_id int,
        dept_id int,
        PRIMARY KEY (user_id, dept_id),
    

    That statement says "only one dept per user" (and both id's are a primary key), but then I can see rows in the data to be inserted like:

        ( 5,  2 ),
        ( 6,  6 ),
        ( 7,  2 ),
        ( 8,  1 ),
        ( 9,  2 ),
    

    where you can see dept_id in the odd rows.

    Also, in INSERT INTO users it seems the shift_start and shift_end fields are missing.

  • allanallan Posts: 63,457Questions: 1Answers: 10,465 Site admin

    Thanks for posting that out - I'll get this fixed and post back when its done. One thing though:

    That statement says "only one dept per user" (and both id's are a primary key), but then I can see rows in the data to be inserted like

    I think the statement is correct. The dept can be reused - i.e. multiple users can be assigned to a single dept.

    Allan

This discussion has been closed.