Is there anyways to have a script to only update and not insert?

I am designing a table to create visitor_id base on cookie. I want to have 2 steps logic

  1. Insert into this table and create visitor_id if no user_id created yet
  2. Update a flag(linked_to_user_id) to 1 if the visitor signed up.
    Is it possible to create 2 scripts on the same table ? (One for insert and create ids and one for update the flag column )?
    Or should I create separate table for this.

Hi @chloeliuyy, did you try the incremental materialization for that purpose ?