Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022099Openbravo ERP00. Application dictionarypublic2012-10-25 08:472013-04-16 13:28
mirurita 
AugustoMauch 
normalmajoralways
newopen 
20Community Appliance
pi 
 
Core
No
0022099: Column name length should be verified to avoid errors in oracle
Column name length should be verified to avoid errors in oracle.
If you develop in PostgreSQL, it is possible to create 30 character length column names and the applications works fine (even the export.database).
But the same code in oracle crashes.
-- POSTGRESQL
1) Using PostgreSQL database create a new module with OBSCNTR as db prefix
2) Add a new column
alter table C_ACCTSCHEMA_DEFAULT add column em_obscntr_pendingservrev_acct character varying(32);
alter table C_ACCTSCHEMA_DEFAULT add CONSTRAINT em_obscntr_acctdef_penservacct FOREIGN KEY (em_obscntr_pendingservrev_acct) REFERENCES c_validcombination (c_validcombination_id);
3) Create the corresponding column:
  - Reference: Search
  - Reference Search Key: Account
4) Create a field for this column
5) Compile and export. No problems, everything is working.

-- ORACLE
6) Copy this module folder to an Oracle environment.
7) ant smartbuild -Dlocal=no
8) You get an error identifier is too long.
No tags attached.
Issue History
2012-10-25 08:47miruritaNew Issue
2012-10-25 08:47miruritaAssigned To => AugustoMauch
2012-10-25 08:47miruritaModules => Core
2013-04-16 13:28AugustoMauchTriggers an Emergency Pack => No
2013-04-16 13:28AugustoMauchNote Added: 0057932
2013-04-16 13:28AugustoMauchTypedefect => design defect

Notes
(0057932)
AugustoMauch   
2013-04-16 13:28   
Oracle does not support schema object names that exceed 30 characters. In the example described in this issue, the schema object name is exactly 30 characters long, so that column is actually created in the database.

The problem is that the new column belong to a table that is used to build a 2.50 window. This is part of the query used to build that window:
...
ELSE TO_CHAR(tableTRL2.Name) END)), ''))),'') ) END) AS EM_Obscntr_Pendingservrev_AcctR,
...

An 'R' has been appended to the column name to form the alias, so the alias is now 31 characters long, and not supported by Oracle.

This issue should only be reproduced when adding a column with a 30 character long name to a table that is used to build a 2.50 window. In order to fix this we should modify some WAD legacy code.