Itgensql056 mismatched input 'pls_integer' expecting

Sinds de upgrade naar 20.2.54 treedt bij het automatisch onderhoud van afgeleide artikelen voor de webshop een foutmelding op:

itgensql056
Syntax error between the two ‘***’ on line 19, column 46:
create or replace proc…a_value_inbouw ***pls_integer*** position 8 , e…
Error: mismatched input ‘pls_integer’ expecting {BFILE, BIGINT, BIGSERIAL, BIT, BLOB, BOOL, BOOLEAN, BPCHAR, BYTE, BYTEA, CHANGES, CHAR, CHARACTER, CLOB, DATE, DATETIME, DATETIMEOFFSET, DEC, DECIMAL, DOUBLE, FLOAT, FLOAT4, FLOAT8, GUID, IMAGE, INT, INT16, INT2, INT32, INT4, INT64, INT8, INTEGER, INTERVAL, LONGBLOB, LONGTEXT, MEDIUMBLOB, MEDIUMINT, MEDIUMTEXT, MONEY, NAME, NCHAR, NUMBER, NUMERIC, NVARCHAR, OID, RAW, REAL, SERIAL, SMALLDATETIME, SMALLINT, SMALLMONEY, SMALLSERIAL, TEXT, TIME, TIMESTAMP, TIMESTAMPTZ, TIMETZ, TINYBLOB, TINYINT, TINYTEXT, UINT16, UINT32, UINT64, UNIQUEIDENTIFIER, UUID, VARBINARY, VARCHAR, VARCHAR2, XML, XMLTYPE, YEAR}.

in de volgende stuk PSQL procedure al bij het compileren:

create or replace procedure calculate_items_soll
as
  l_dummy varchar2;
begin
  create or replace table branddeviations@inmemorystorage
  as
  select * 
  from   exceltable
         ( name 'brandspecific'
           passing file '${FILE_NAME_PATH_EXTEND_ORIG}'
           skip first 1 rows
           columns code                       varchar2    position 1
           ,       extra_value_code_orig      varchar2    position 2
           ,       extra_value_brand_postfix  varchar2    position 3
           ,       description                varchar2    position 4
           ,       itemgroupcode              varchar2    position 5
           ,       PRICE                      number      position 6
           ,       price_combined             number      position 7
           ,       extra_value_inbouw         pls_integer position 8
           ,       extra_value_inbouw_brand   pls_integer position 9
           ,       extra_value_speciaal       pls_integer position 10
           ,       extra_value_speciaal_brand pls_integer position 11
         )
  where  ( extra_value_inbouw_brand is not null or extra_value_speciaal_brand is not null )
  ;
  create or replace table items_soll@inmemorystorage
  ...

Hoe kan ik dit oplossen?

Door de introductie van nieuwe Invantive PSQL datatypes voor Excel werkboeken en Excel werkbladen is het niet meer mogelijk om het datatype pls_integer te gebruiken in SQL-statements.

In dit geval staat in de PSQL-code een SQL-statement create or replace table ... die gebruikmaakt van pls_integer.

Dit is helaas een breaking change waardoor sommige bestaande SQL-statements niet meer compileren.

De oplossing is in het algemeen om het PSQL-only datatype pls_integer te vervangen door integer.

In dit geval leidt dat tot de volgende code:

create or replace procedure calculate_items_soll
as
  l_dummy varchar2;
begin
  create or replace table branddeviations@inmemorystorage
  as
  select * 
  from   exceltable
         ( name 'brandspecific'
           passing file '${FILE_NAME_PATH_EXTEND_ORIG}'
           skip first 1 rows
           columns code                       varchar2    position 1
           ,       extra_value_code_orig      varchar2    position 2
           ,       extra_value_brand_postfix  varchar2    position 3
           ,       description                varchar2    position 4
           ,       itemgroupcode              varchar2    position 5
           ,       PRICE                      number      position 6
           ,       price_combined             number      position 7
           ,       extra_value_inbouw         integer     position 8
           ,       extra_value_inbouw_brand   integer     position 9
           ,       extra_value_speciaal       integer     position 10
           ,       extra_value_speciaal_brand integer     position 11
         )
  where  ( extra_value_inbouw_brand is not null or extra_value_speciaal_brand is not null )
  ;
  create or replace table items_soll@inmemorystorage
  ...