Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

Can't add the DECIMALS and CASE-SENSITIVE field options with the ADD-NEW-FIELD method

« Go Back

Information

 
Article Number000090104
EnvironmentProduct: OpenEdge
Version: 10.x, 11.x
OS: All supported platforms
Question/Problem Description
Can't add the DECIMALS and CASE-SENSITIVE field options with the ADD-NEW-FIELD method

The dynamic temp table ADD-NEW-FIELD method doesn't support the CASE-SENSITIVE and DECIMALS attributes. So they can't be set when adding a new field to a dynamic temp table. These buffer field object attributes are read-only, so they can't be changed after the field is created.

In contrast the static temp table definition does support these attributes:

DEFINE TEMP-TABLE tt1
    FIELD cName    AS CHAR    INIT 'SomeCaseSensitiveValue' CASE-SENSITIVE
    FIELD dBalance AS DECIMAL FORMAT ">999.99" DECIMALS 3.


A dynamic temp table field can be created using the ADD-LIKE-FIELD method based on an existing temp table or database table field.  But if the application uses only dynamic temp tables, it's hard to use ADD-LIKE-FIELD to create dynamic temp table fields with these attributes.

Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement NumberDefect OCTA-6868
Cause
The exact cause is not known at this time.
Resolution
None at this time.
Workaround
If possible base the new field on an existing database or temp table field that already has these attributes set:
DEFINE VARIABLE ttCustomer  AS HANDLE NO-UNDO.
DEFINE VARIABLE bttCustomer AS HANDLE NO-UNDO.

DEFINE TEMP-TABLE tt1
    FIELD cName    AS CHAR    INIT 'SomeCaseSensitiveValue' CASE-SENSITIVE
    FIELD dBalance AS DECIMAL FORMAT ">999.99" DECIMALS 3.

CREATE tt1.  
CREATE TEMP-TABLE ttCustomer.
ttCustomer:CREATE-LIKE('Customer'). 
ttCustomer:ADD-LIKE-FIELD("csName","tt1.cName").
ttCustomer:ADD-LIKE-FIELD("dBalance","tt1.dBalance").
ttCustomer:TEMP-TABLE-PREPARE( "dynttCustomer" ).
bttCustomer = ttCustomer:DEFAULT-BUFFER-HANDLE.
bttCustomer:BUFFER-CREATE().

MESSAGE
    "bttCustomer:BUFFER-FIELD('csName'):BUFFER-VALUE() : " bttCustomer:BUFFER-FIELD("csName"):BUFFER-VALUE() SKIP(1)
    "bttCustomer:BUFFER-FIELD('csName'):BUFFER-VALUE() : = 'SomeCaseSensitiveValue'" bttCustomer:BUFFER-FIELD("csName"):BUFFER-VALUE() = 'SomeCaseSensitiveValue' SKIP(1)
    "bttCustomer:BUFFER-FIELD('csName'):BUFFER-VALUE() : = 'somecasesensitivevalue'" bttCustomer:BUFFER-FIELD("csName"):BUFFER-VALUE() = 'somecasesensitivevalue' SKIP(1)    
    VIEW-AS ALERT-BOX.
User-added image

Use the BUFFER-FIELD method for these comparisons, the double colon notation doesn't consider case sensitivity.  This is logged as a defect.  Please see article 000100767, The double colon notation '::' with dynamic temp table fields is not case sensitive
Notes
Attachment 
Last Modified Date1/24/2020 11:34 AM