# Using result from one changeset in another

**URL:** https://forum.liquibase.org/t/using-result-from-one-changeset-in-another/715
**Category:** General Discussion
**Created:** [August 13, 2010, 5:33am UTC](https://forum.liquibase.org/t/using-result-from-one-changeset-in-another/715 "2010-08-13T05:33:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![confik](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@confik](https://forum.liquibase.org/u/confik)
#### Post date: [August 13, 2010, 5:33am UTC](https://forum.liquibase.org/t/using-result-from-one-changeset-in-another/715/1 "2010-08-13T05:33:00Z")

</div>

Hi, Nathan!  
I’m using MySQL and have the following problem:  
I have to insert a row in one autoinremented table and then use inserted id of that record in another changeset.  
I could manage it only with tag, is there a way to do it using ? Or maybe save some value in block?

```
<changeSet id="1" author="confik">
	<insert tableName="modules">			
		<column name="name" value="marketing"/>
	</insert>
</changeSet>

<changeSet id="2" author="confik">
	<!-- added additional modules access rights -->
	<sql>		
	INSERT INTO module_access (module_id, type) SELECT id, 'view'&nbsp; FROM modules WHERE name = 'marketing'
	</sql>
</changeSet>

```

---

<div class="post-metadata">

### Author: ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)
#### Post date: [August 13, 2010, 5:33am UTC](https://forum.liquibase.org/t/using-result-from-one-changeset-in-another/715/2 "2010-08-13T05:33:00Z")

</div>

Currently there is not a way to get at the auto-generated ID values in a later changetSet.&nbsp; You’ll have do do it with the nested select for now.&nbsp; You may be able to create an extension for the tag ([http://liquibase.org/extensions)](http://liquibase.org/extensions)) until there is official support for it.

Nathan

---

<div class="post-metadata">

### Author: ![confik](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@confik](https://forum.liquibase.org/u/confik)
#### Post date: [August 13, 2010, 5:33am UTC](https://forum.liquibase.org/t/using-result-from-one-changeset-in-another/715/3 "2010-08-13T05:33:00Z")

</div>

Thanks for the answer.
