# ORA-00936: missing expression with identity column

**URL:** <https://discourse.hibernate.org/t/ora-00936-missing-expression-with-identity-column/5308>\
**Category:** Hibernate ORM\
**Created:** [April 29, 2021, 9:19pm UTC](https://discourse.hibernate.org/t/ora-00936-missing-expression-with-identity-column/5308 "2021-04-29T21:19:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nassiesse](https://avatars.discourse-cdn.com/v4/letter/n/977dab/32.png) [@Nassiesse](https://discourse.hibernate.org/u/Nassiesse)\
**Post date:** [April 29, 2021, 9:19pm UTC](https://discourse.hibernate.org/t/ora-00936-missing-expression-with-identity-column/5308/1 "2021-04-29T21:19:21Z")

</div>

Hello everyone,  
I’ve got an error persisting data in Oracle12c database.

This is my table with only one column defined as identity:

```auto
CREATE TABLE rv_numeric_id
(	
	numeric_id NUMBER(19,0) GENERATED ALWAYS AS IDENTITY MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE NOKEEP NOSCALE NOT NULL , 
	PRIMARY KEY (numeric_id)
);

```

the entity is defined correctly (IMO):

```auto
@Entity
@Data
@Table(name = "RV_NUMERIC_ID")
public class RvNumericIdSequence {

    @Id
    @Column(name = "NUMERIC_ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long numericId;
}

```

but when hibernate try to persist data get this error:

```auto
SQL Error: 936, SQLState: 42000
 ORA-00936: missing expression

```

The problem is the query generated by the orm:

```auto
insert into rv_numeric_id values ( )

```

This query is not compliant with oracle sql syntax, it should be like this:

```auto
insert into rv_numeric_id values ( DEFAULT)

```

anyone have had the same problem?

Thanks

---

<div class="post-metadata">

**Author:** ![Nassiesse](https://avatars.discourse-cdn.com/v4/letter/n/977dab/32.png) [@Nassiesse](https://discourse.hibernate.org/u/Nassiesse)\
**Post date:** [April 29, 2021, 10:25pm UTC](https://discourse.hibernate.org/t/ora-00936-missing-expression-with-identity-column/5308/2 "2021-04-29T22:25:44Z")

</div>

Ok, I solved adding the explicit sql insert query in entity annotation

```auto
@SQLInsert( sql="insert into rv_numeric_id values (DEFAULT)")

```

Probably it’s not the best solution, but it seems works.
