G
G
guit242021-11-30 02:27:34
SQLite
guit24, 2021-11-30 02:27:34

How to populate 2 columns of different tables with the same sqllite3 data at the same time?

How to populate 2 columns of different tables with the same sqllite3 data at the same time? i.e. entering data into one table (such as autoincrement) in one column, so that the same data as a foreign key was written in another table automatically?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-11-30
@rPman

you create a trigger before insert (and on update too) and write the necessary code there, the data will be available from the 'table' new type insert into table_b (id, new_val) values ​​(new.id, new.val)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question