Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047840Openbravo ERP09. Financial managementpublic2021-10-13 13:012021-10-14 09:53
fernando_merino 
fernando_merino 
normalmajoralways
closedfixed 
5
 
 
Core
No
0047840: API Change: Change DESCRIPTION column from VARCHAR to NVARCHAR type in FIN_PAYMENT table
This problem occurs only on an Oracle database. The problem is that the DESCRIPTION column is defined as VARCHAR2(255 BYTE). The DESCRIPTION field is limited to 255 CHARACTERS long, so if all these characters don't exceed the limit of 255 BYTES there is no problem (e.g 255 characters of 1 BYTE each). The problem comes when the description contains special characters larger than 1 BYTE. If the description is a long one, for example one with 255 characters, the characters limit is not exceeded, but if it contains some characters larger than 1 BYTE, like for example the º character that occupies 2 BYTES, then the limit of 255 BYTES is exceeded (254 one-byte characters, plus one of 2 bytes make 256 bytes, which do not fit in the field defined in the database).
Using Oracle database:
1. Go to 'Payment in', window which makes use of FIN_PAYMENT table.
2. Create a new record and in the DESCRIPTION field input a long description reaching the limit of 255 characters and containing some characters larger than 1 BYTE, like for example the º characters. Try with this description for example --> 'This is a description example:ººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººº'
3. Try to save the record, you will get an error similar to this one: ERROR: Saving failed. ORA-12899: value too large for column "ERP_PI_ORACLE"."FIN_PAYMENTMETHOD"."DESCRIPTION" (actual: 480, maximum: 255)
1. Change column type of the DESCRIPTION field from VARCHAR to NVARCHAR
(Risk statement --> See notes)
Approved
blocks defect 0047765 closed fernando_merino Problem posting multiple invoices in the same collection 
Issue History
2021-10-13 13:01fernando_merinoNew Issue
2021-10-13 13:01fernando_merinoAssigned To => dmitry_mezentsev
2021-10-13 13:01fernando_merinoModules => Core
2021-10-13 13:01fernando_merinoTriggers an Emergency Pack => No
2021-10-13 13:02fernando_merinoNote Added: 0132316
2021-10-13 13:03fernando_merinoRelationship addedblocks 0047765
2021-10-13 13:45dmitry_mezentsevTag Attached: Approved
2021-10-13 13:45dmitry_mezentsevAssigned Todmitry_mezentsev => fernando_merino
2021-10-14 09:40hgbotNote Added: 0132337
2021-10-14 09:53hgbotResolutionopen => fixed
2021-10-14 09:53hgbotStatusnew => closed
2021-10-14 09:53hgbotNote Added: 0132341
2021-10-14 09:53hgbotNote Added: 0132342

Notes
(0132316)
fernando_merino   
2021-10-13 13:02   
API change risk:

Risk --> small

- NVARCHAR is going to support the same data that VARCHAR was supporting. 255 characters will
continue to be the characters limit, but now special characters are allowed in long descriptions
reaching this characters limit.
- JAVA API doesn't change, the property of the DAL object will continue being treated as String type.
- Only instances using Oracle database could be affected
- Additionally, the api-check considers this change as a warning. This is the result:
 [checkAPI] 11451 [main] WARN org.openbravo.ddlutils.task.CheckAPIDistribution - +++++++++++++++++++++++++++++++++++++++++++++++++++
 [checkAPI] 11452 [main] WARN org.openbravo.ddlutils.task.CheckAPIDistribution - Warnings in API model validation
 [checkAPI] 11452 [main] WARN org.openbravo.ddlutils.task.CheckAPIDistribution - +++++++++++++++++++++++++++++++++++++++++++++++++++
 [checkAPI] 11452 [main] WARN org.openbravo.ddlutils.task.CheckAPIDistribution - Column type change from VARCHAR to NVARCHAR: column:FIN_PAYMENT.DESCRIPTION
 [checkAPI] 11452 [main] WARN org.openbravo.ddlutils.task.CheckAPIDistribution -
(0132337)
hgbot   
2021-10-14 09:40   
Merge Request created: https://gitlab.com/openbravo/ci/backoffice-api/-/merge_requests/15 [^]
(0132341)
hgbot   
2021-10-14 09:53   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/ci/backoffice-api [^]
Changeset: 5939c63b55ae9dd8064b49606c384b0bd1ffe006
Author: fernando_merino <fernando.merino@openbravo.com>
Date: 2021-10-14T09:31:14+02:00
URL: https://gitlab.com/openbravo/ci/backoffice-api/-/commit/5939c63b55ae9dd8064b49606c384b0bd1ffe006 [^]

Fixes ISSUE-47840: Change type definition of column FIN_PAYMENT from VARCHAR to NVARCHAR

Changed DESCRIPTION column type from VARCHAR to NVARCHAR so
in that way the limit of 255 bytes is not exceeded when
introducing long descriptions with characters larger than 2
bytes.

---
M model/src-db/database/model/tables/FIN_PAYMENT.xml
---
(0132342)
hgbot   
2021-10-14 09:53   
Merge request merged: https://gitlab.com/openbravo/ci/backoffice-api/-/merge_requests/15 [^]