# TemporaryTable identity column sqlTypeName error

**URL:** <https://discourse.hibernate.org/t/temporarytable-identity-column-sqltypename-error/9205>\
**Category:** Hibernate ORM\
**Created:** [March 15, 2024, 10:53am UTC](https://discourse.hibernate.org/t/temporarytable-identity-column-sqltypename-error/9205 "2024-03-15T10:53:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VladoKuruc](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vladokuruc/32/3100_2.png) [@VladoKuruc](https://discourse.hibernate.org/u/VladoKuruc)\
**Post date:** [March 15, 2024, 10:53am UTC](https://discourse.hibernate.org/t/temporarytable-identity-column-sqltypename-error/9205/1 "2024-03-15T10:53:02Z")

</div>

During testing on a local Informix database, a syntax error occurred in the test org.hibernate.orm.test.hql.BulkManipulationTest#testInsertAcrossMappedJoin when trying to create a temporary table.

```auto
create temp table HTE_Joiner(
HTE_IDENTITY int8 serial8 not null,
 id int8,
 joinedName varchar(255),
 name varchar(255),
 primary key (HTE_IDENTITY))
 with no log

```

In my opinion, the error lies within the org.hibernate.dialect.temptable.TemporaryTable class, specifically at line 323 during the creation of the TemporaryTableColumn identity. The method hasDataTypeInIdentityColumn() from the dialect is not being considered here, unlike in org.hibernate.tool.schema.internal.ColumnDefinitions#appendColumnDefinition. When I took this into account, the resulting CREATE TEMP TABLE command was correct, and the unit test passed without errors.

Here’s my modification:

```auto
String sqlTypeName = "";
if (dialect.getIdentityColumnSupport().hasDataTypeInIdentityColumn()) {
    sqlTypeName = column.getSqlType(runtimeModelCreationContext.getMetadata()) + " ";
}
sqlTypeName = sqlTypeName + dialect.getIdentityColumnSupport().getIdentityColumnString(column.getSqlTypeCode(runtimeModelCreationContext.getMetadata()));
columns.add(
       new TemporaryTableColumn(
             temporaryTable,
             ENTITY_TABLE_IDENTITY_COLUMN,
             jdbcMapping,
             sqlTypeName,
             column.getColumnSize(
                   dialect,
                   runtimeModelCreationContext.getMetadata()
             ),
             // Always report as nullable as the identity column string usually includes the not null constraint
             true,//column.isNullable()
             true
       )
);

```

I’m not sure if this solution is correct for all other dialects. By the way, where can I find the results of matrix tests for other dialects (at least those supported by you)?

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 15, 2024, 11:03am UTC](https://discourse.hibernate.org/t/temporarytable-identity-column-sqltypename-error/9205/2 "2024-03-15T11:03:40Z")

</div>

You can find the results [on GitHub](https://github.com/hibernate/hibernate-orm/actions/workflows/contributor-build.yml?query=branch%3Amain).

If you think you found a bug, please [create a Jira issue](https://hibernate.atlassian.net) for the problem and try to create a PR with a fix. The PR will then be automatically tested against all supported database configurations.
