Previous Topic: Example of Pre-Release 5.2 SQL NamingNext Topic: Long Name Scenarios


Understanding Extended SQL Naming

EXEC SQL                                             
     COMMENT ON RWCSQL.ORDL1 (                       
           ABABCD   IS   ‘Order code’                
          ,ABADCD   IS   ‘Customer code’             
          ,ABACTX   IS   ‘Customer name’             
          ,ABABST   IS   ‘Order status’              
          ,ABABDT   IS   ‘Order date’                
                                         )           
END-EXEC                                             
                                                     
EXEC SQL                                             
     LABEL ON TABLE RWCSQL.ORDL IS                   
         ‘Orders       Retr’                         
END-EXEC                                             
                                                     
EXEC SQL                                             
     CREATE UNIQUE INDEX RWCSQL.ORDL1I ON RWCSQL.ORDP
         (ABABCD        ASC                          
          )                                          
END-EXEC                                            

The optional extended SQL naming feature assigns longer, more meaningful names as follows:

Special Character in Model

Mapped to in the SQL Name

~ ! ‘ % & * ( ) { }

| " \ / < > = - +

: ; . , ? [ ] ยข

blank

Underscore ( _ )

 

 

 

 

Lowercase letters

Uppercase letters

Note: When you generate the SQL/DDL with certain column names, they fail to generate and throw error messages. However, using the same field names for the DDS implementation result in successful generation.

Example: If you have a field starting with a number such as “2nd_Order”, the SQL/DDL fails to generate a table with such column name with the following error:

“SQL0103 - Numeric constant 2nd_Order not valid.” 

However, the DDS implementation with the same field name is successfully generated.