How to insert default values into the table along with a variable value?

Asked

Viewed 30 times

0

Setting:

I have a database with 2 tables, table A has the screens of an app, and screen B records the activity on each screen, getting this way:

   ____________________
  | Tabela A          |
   -------------------
  | id | tela         |
  | 0  | principal    |
  | 1  | menu         |
  | 2  | visualização |
   -------------------

   ___________________________
  | Tabela B          |       |
   ---------------------------
  | id | acoes        | tela  |
  | 0  | acao_1       |  0    |
  | 1  | acao_2       |  2    |
  | 2  | acao_3       |  1    |
   ---------------------------

As I am adding actions in table B, and already having a screen reference table, table A, I would like to know if the screen field, could be auto filled as the action is inserted in table B.

  • Maybe a Rigger could help you

  • I don’t think I understand. You already have a table to store action and screen, ai want to add an action according to the screen that is in table A right? Basically in the Insert in table B you specify the screen. There is no other way to do this with many for many

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.