Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Values for Interval columns with Precision generates invalid package #59

Open
AKEIT opened this issue May 3, 2024 · 1 comment
Labels

Comments

@AKEIT
Copy link

AKEIT commented May 3, 2024

When creating a table with a column of type Interval and specifying a default value with precision, the TAPI generator creates a non-compilable package.

Example code:

create sequence intervals_seq;

create table intervals(
  id number(9,0) default intervals_seq.nextval not null primary key,
  after_days INTERVAL DAY (4) TO SECOND (0) DEFAULT INTERVAL '360' DAY(3));
  
exec om_tapigen.compile_api(p_table_name => 'INTERVALS',p_enable_column_defaults => true);

This results in the following definition within the package:

FUNCTION create_row (
  p_id         IN "INTERVALS"."ID"%TYPE         DEFAULT "INTERVALS_SEQ"."NEXTVAL" /*PK*/,
  p_after_days IN "INTERVALS"."AFTER_DAYS"%TYPE DEFAULT INTERVAL '360' DAY(3) )
RETURN "INTERVALS"."ID"%TYPE;

However, it should read:

FUNCTION create_row (
  p_id         IN "INTERVALS"."ID"%TYPE         DEFAULT "INTERVALS_SEQ"."NEXTVAL" /*PK*/,
  p_after_days IN "INTERVALS"."AFTER_DAYS"%TYPE DEFAULT INTERVAL '360' DAY)
RETURN "INTERVALS"."ID"%TYPE;

We are using:
Database: Oracle Database 19c
OM_TAPIGEN Version: 0.6.3

@ogobrecht
Copy link
Member

Hi, need to look into this. Thanks for reporting. Will come back to you

@ogobrecht ogobrecht added the bug label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants