# Automatically insert into table on Liquibase Update

**URL:** https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169
**Category:** General Discussion
**Created:** [March 4, 2024, 4:23pm UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169 "2024-03-04T16:23:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![RolandP](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RolandP](https://forum.liquibase.org/u/RolandP)
#### Post date: [March 4, 2024, 4:23pm UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169/1 "2024-03-04T16:23:39Z")

</div>

Hi,  
we are trying to switch to Liquibase in our company. We found that logging of the statements with Liquibase is possible and it works. Now we would like to know, if there is a way, to automatically insert the executed SQL statements in a DB Table? Normally, with our old System we logged the DDL statements, therefore the question. But i didn’t found anything about such a possibility.  
Thanks!

---

<div class="post-metadata">

### Author: ![daryldoak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/daryldoak/32/764_2.png) [@daryldoak](https://forum.liquibase.org/u/daryldoak)
#### Post date: [March 4, 2024, 10:01pm UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169/2 "2024-03-04T22:01:59Z")

</div>

With the right logging level (sql-log-level=INFO) Liquibase will provide every executed SQL statement in the output. We take that output and insert it into a table for history.

---

<div class="post-metadata">

### Author: ![RolandP](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RolandP](https://forum.liquibase.org/u/RolandP)
#### Post date: [March 5, 2024, 7:12am UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169/3 "2024-03-05T07:12:44Z")

</div>

Thank you daryldoak. How do you take that output? Did you write an own program that reads that log file? Or is there a way to let this do liquibase automatically?

---

<div class="post-metadata">

### Author: ![daryldoak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/daryldoak/32/764_2.png) [@daryldoak](https://forum.liquibase.org/u/daryldoak)
#### Post date: [March 5, 2024, 2:22pm UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169/4 "2024-03-05T14:22:42Z")

</div>

We wrote our own program.

---

<div class="post-metadata">

### Author: ![wwillard](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wwillard](https://forum.liquibase.org/u/wwillard)
#### Post date: [March 6, 2024, 5:45pm UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169/5 "2024-03-06T17:45:48Z")

</div>

Another option would be to use the `update-sql` command, which shows all the SQL that will be executed. That could be inserted without needing to strip the logging.

---

<div class="post-metadata">

### Author: ![RolandP](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RolandP](https://forum.liquibase.org/u/RolandP)
#### Post date: [March 7, 2024, 7:15am UTC](https://forum.liquibase.org/t/automatically-insert-into-table-on-liquibase-update/9169/6 "2024-03-07T07:15:10Z")

</div>

Thank you all for your help.
