| Summary: | CHAR and GRAPHIC columns fetched from SQL tables do not have trailing blanks truncated. | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Paul Hoffman <hoffmanp> |
| Component: | EDT | Assignee: | Joseph Vincens <jvincens> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | chenzhh, jqian, jvincens, tww |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The idea for EDT is to do as little hidden code as possible while exposing as much of the environment (in this java) functionality as possible. The recommendation that I've found for Java developers is to use a DB function in the select SELECT RTRIM(mycolumn) FROM ... So the runtime won't do any auto trimming. The tooling CTRL ^ 1 should provide 2 choices for the select statement, the current, and a new one that adds RTRIM to all of the CHAR or NCHAR columns. Java should not be the model for how to handle CHAR columns since Java has no CHAR data type. The true models for handling CHAR columns are DB2 and COBOL. They do not treat trailing blanks as significant in comparing text values. Java's implementation has the anomaly that the key value that selects a row from a DB2 table can treated by Java as not equal to the column value returned on the fetch. Developers have to code around this by using RTRIM. An enterprise tool worth its name should be smart enough not to require developers to worry about this. If you don't want to hide this, use the RTRIM in the default SQL statement built by EGL. After all, shouldn't our default statement follow recommended practice? I am assuming the defect is found in creating record from SQL database. And if trailing blanks are truncated, do SQL operations are affected? Based on Paul's comment, they should not be affected. Modify DataToolsSqlColumnTemplate Please explain how this is fixed. What annotation causes RTRIM to be added to column name select list? for all database type which is mapped to egl string, add rtrim() in default generated SQL RTRIM needs to be added to default SQL statement both in the default statement created at runtime and in the statement suggested in the IDE when the developer hits CNTL-1. fixed Closed and verified |
Build Identifier: EDT 0.7.0.v201110040852 CHAR columns fetched from SQL tables do not have trailing blanks truncated. Blanks should be truncated on the fetch to be consistent with RBD behavior and RBD char to string assignments. If blanks are not truncate then statements like the following will throw an exception when the column read contains the value "Some Char 2 ": if ( row.aString != "Some Char 2" ) throw new anyexception { message = "Read row 2; row.aChar = '" + row.aChar + "'" } ; end This is a little painful for test case development. Text fields will have to be clipped before being compared to literals. Reproducible: Always