# Sequence value while inserting the data in table.

**URL:** <https://forum.liquibase.org/t/sequence-value-while-inserting-the-data-in-table/1567>\
**Category:** General Discussion\
**Created:** [August 1, 2011, 6:26pm UTC](https://forum.liquibase.org/t/sequence-value-while-inserting-the-data-in-table/1567 "2011-08-01T18:26:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amardeeptalwar](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@amardeeptalwar](https://forum.liquibase.org/u/amardeeptalwar)\
**Post date:** [August 1, 2011, 6:26pm UTC](https://forum.liquibase.org/t/sequence-value-while-inserting-the-data-in-table/1567/1 "2011-08-01T18:26:00Z")

</div>

How do we handle the scenario when we have to insert the surrogate key generated from the sequence in to the table. Is there any possible way that sequence key can be input to one of the value in the column.

E.g:&nbsp;INSERT INTO label(label\_id) values ( **SEQ\_LABEL\_ID.NEXTVAL** )

&nbsp;

\<databaseChangeLog

&nbsp; xmlns=“[http://www.liquibase.org/xml/ns/dbchangelog](http://www.liquibase.org/xml/ns/dbchangelog)”

&nbsp; xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)”

&nbsp; xsi:schemaLocation="[http://www.liquibase.org/xml/ns/dbchangelog](http://www.liquibase.org/xml/ns/dbchangelog)

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd](http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd)"\>

&nbsp;

&nbsp; &nbsp;

&nbsp; &nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [August 1, 2011, 6:26pm UTC](https://forum.liquibase.org/t/sequence-value-while-inserting-the-data-in-table/1567/2 "2011-08-01T18:26:00Z")

</div>

You can use the attribute “valueComputed”

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [August 1, 2011, 6:26pm UTC](https://forum.liquibase.org/t/sequence-value-while-inserting-the-data-in-table/1567/3 "2011-08-01T18:26:00Z")

</div>

Working Example:

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [August 1, 2011, 6:26pm UTC](https://forum.liquibase.org/t/sequence-value-while-inserting-the-data-in-table/1567/4 "2011-08-01T18:26:00Z")

</div>

Hello.  
  
I have the same issue, but it doesn’t work for me that way.  
If I try the solution above, I get a SQLException: "Missing IN- or OUT-Parameter on Index:: 1"  
  
I’m using Liquibase 2.0.4 and Oracle 11g.  
  
Beside that, this makes the insert-Tag pretty much oracle-dependend, which I’d prefer to avoid. I don’t want to have separate inserts for every database I have to support (the very reason I’m using Liquibase in the first place).  
  
Is there a more database independent solution?  
  
Thanx,  
Sven
