Skip to content

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

Open
@AKEIT

Description

@AKEIT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions