IBM / ibmi-bob

A build system for creating IBM i-native objects using GNU Make.
https://ibm.github.io/ibmi-bob
Apache License 2.0
47 stars 20 forks source link

'LABEL ON TABLE' not occurring in Bob compilation in all situations. #338

Open bmcpherson-srlife opened 4 weeks ago

bmcpherson-srlife commented 4 weeks ago

Hello all,

I've noticed when tables are being generated for a project, the LABEL ON TABLE statement does not appear to be executing in all instances. I can take the same code and run it directly in the "Run SQL Scripts" utility with the expected results. However, not all code run into this issue. Below are two examples:

  1. This first one runs just fine in Bob:
CREATE OR REPLACE TABLE system_tokens FOR SYSTEM NAME systken ( 
    system_token FOR COLUMN token CHAR(32) NOT NULL DEFAULT '',
  expiration_timestamp FOR COLUMN expires TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY ( system_token )

)   

RCDFMT systkenr ; 

LABEL ON TABLE system_tokens 
    IS 'System Token File' ; 

LABEL ON COLUMN system_tokens ( 
  system_token IS 'System Token',
  expiration_timestamp  IS 'Expiration Timestamp'
) ; 

LABEL ON COLUMN system_tokens  ( 
  system_token TEXT IS 'System Token', 
  expiration_timestamp  TEXT IS 'Expiration Timestamp'
) ; 

However, this next one does not appear to recognize the LABEL ON TABLE. No errors were generated in the log (see further below)

CREATE OR REPLACE TABLE mea_session_tokens FOR SYSTEM NAME meaptken ( 
    agent_number         FOR COLUMN TKENAGT# NUMERIC(6, 0) NOT NULL DEFAULT 0 , 
    session_token        FOR COLUMN TKENTKEN CHAR(32) NOT NULL DEFAULT '' , 
    expiration_timestamp FOR COLUMN TKENEXP  TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , 

  -- Constraints
    PRIMARY KEY( agent_number ) 
)   

RCDFMT meapwtkenr ; 

-- Add Text to the Table
LABEL ON TABLE mea_session_tokens 
    IS 'MEA Session Token File' ; 

LABEL ON COLUMN mea_session_tokens ( 
  agent_number         IS 'Agent Number' , 
    session_token        IS 'Session Token' , 
    expiration_timestamp IS 'Expiration Timestamp' 
) ; 

LABEL ON COLUMN mea_session_tokens ( 
  agent_number         TEXT IS 'Agent Number' , 
    session_token        TEXT IS 'Session Token' , 
    expiration_timestamp TEXT IS 'Expiration Timestamp' 
) ; 

ibmi_output_log.txt