All Questions

Tagged with
Filter by
Sorted by
Tagged with
9votes
2answers
27kviews

H2 and Oracle Compatiability issues

I am having an issue executing the following script using Flyway and H2 database. I assume its a Oracle compatibility issue but I am using H2 with the correct mode. This script is used to construct ...
user avatar
  • 659
8votes
2answers
1kviews

Change datatype of a sequence H2DB

I need to change the returned value of a sequence stored into a H2DB, when i call nextVal through a direct SQL query H2 return a BigInt and i need a BigDecimal. I can't cast or convert this value, I ...
user avatar
  • 101
6votes
4answers
4kviews

How to find if a column name is a reserved keyword across various databases

We have a legacy schema file which has the following column names, would like to understand if any of them would cause an issue if we port our application to h2, mysql, postgres or oracle. e.g how ...
user avatar
6votes
2answers
14kviews

Convert special String into Date in H2

There is a SQL function from Oracle to_date('26 Jul 2016, 05:15:58 AM','DD Mon YYYY, HH:MI:SS AM'), and it throws exception "Illegal pattern character 'o'" in H2. How shall I change it to make it ...
user avatar
  • 199
6votes
2answers
3kviews

H2 with MODE=Oracle causes 'Schema "information_schema" not found'

I'm building app with Spring Boot 1.5.4.RELEASE and I want to use H2 with Flyway. My application.properties are: spring.datasource.url=jdbc:h2:mem:test;MODE=Oracle;DB_CLOSE_ON_EXIT=FALSE;...
user avatar
  • 929
6votes
0answers
2kviews

H2 Oracle compatibility for RENAME COLUMN statement

I am using Oracle for production and H2 as an in-memory test database. I'm having trouble with Oracle compatibility for the "rename column" statement. Specifically, the Oracle statement is: alter ...
user avatar
5votes
3answers
14kviews

Create Function in h2 from Oracle

i have the following function in oracle that i have to translate into h2. Could anyone help me. I have no idea to do this: create or replace function unpack_info (p_trackchar table.ordchar%type) ...
user avatar
  • 841
5votes
2answers
16kviews

Set H2 schema on connection

I am configuring an h2 test database for our oracle production database. All tables are of the schema xxx. My datasource is defined as below: public DataSource dataSource() { JdbcDataSource ds = ...
user avatar
  • 10.5k
5votes
1answer
6kviews

PARTITION BY doesn't work in H2 db

I'm using PARTITION BY clause to do sorting on the result. Details for using PARTITION BY is mentioned in this question Sql Order by on multiple column. It works fine when i run in Oracle. I'm using ...
user avatar
  • 3,242
5votes
1answer
2kviews

Oracle to H2/hsqldb etc adapter

I can't be the only person who has this problem so I am looking for suggestions. We run our apps on Oracle but our integration tests use h2 for speedy in-memory testing, the database being built from ...
user avatar
5votes
1answer
3kviews

Lock Table with exclusive in H2 database

I am having trouble to convert Oracle syntax to H2 syntax: For example (Oracle): LOCK TABLE CAR_CHIP_ID_LOCK IN EXCLUSIVE MODE In H2 it results in a (syntax error) How do I change the oracle ...
user avatar
  • 1,856
4votes
1answer
5kviews

What does the jpa @SequenceGenerator.allocationSize mean?

I googled a lot and found many people said the allocationSize means 'After 'allocationSize' is reached, the next id will be retrieved from the database sequence again' in https://www.logicbig.com/...
user avatar
  • 2,722
4votes
1answer
9kviews

Does H2 support PLSQL when using Oracle mode?

I'm trying to write some functional tests for our java application using H2 in-memory database. Since we use Oracle as our production DB, some of the code is written in PL/SQL. So I switched on Oracle ...
user avatar
4votes
1answer
4kviews

Conditional Unique index on h2 database

I have a SAMPLE_TABLE with a column BIZ_ID which should be unique when the column active is not equal to 0. On an oracle database the index looks like this: CREATE UNIQUE INDEX ACTIVE_ONLY_IDX ON ...
user avatar
4votes
2answers
5kviews

Hierarchical Queries in H2

I have the following query, which works fine in Oracle: SELECT ID FROM PEOPLE START WITH ID = <person_id> CONNECT BY PRIOR PARENT_ID = ID; This works on a self-referencing table, which ...
user avatar

15 30 50 per page
1
2 3 4 5
8