Rocket Aldon

 SQL Table / View "for system name"

David Taylor's profile image
David Taylor posted 09-23-2021 12:36
I am new to Aldon.  I created a table and a view the way I had in the past with a long name and a system name. The version with the system name would not compile with the 14 option.  It compiled fine just running the SQL statements outside of Aldon. Is there a better way to handle this?  

VWACTDTL *VIEW SQL 

Good: 
CREATE OR REPLACE VIEW VWACTDTL (
ENTITY_TRUST FOR COLUMN CUSACC,

Bad:
CREATE OR REPLACE VIEW Account_Detail_View
for system name VWACTDTL (
ENTITY_TRUST FOR COLUMN CUSACC,
Don Broadbridge's profile image
ROCKETEER Don Broadbridge
Hi David,

When handling SQL objects in LMi you should remove the hard-coded library name out of the code because as you create and promote LMi will include the appropriate environment library name in each level.

Thanks
Dale Asher's profile image
ROCKETEER Dale Asher
Hi David, 
Don is right on the use of qualifiers, but I'm not seeing them here.
I'm including a screenshot of the 'shell game' for managing / controlling system naming with 'long names'.
Use of 'rename...to...for system name' in lmi sql source members

I think something like this should work for your example: 
CREATE VIEW VWACTDTL (
ENTITY_TRUST FOR COLUMN CUSACC);
rename view VWACTDTL to Account_Detail_View 
   for system name VWACTDTL;
​
David Taylor's profile image
David Taylor
So the short answer is "Aldon does not like that standard format." :)   Thanks for the example @Dale Asher.  I tired it to no avail.  I will keep hoping. I tired taking out the "VIEW VWACTDTL" as the error stated it wanted TO at position 52.  No luck. 

20 A1PF T03 ON (T01.VENDR = T03.VENDR) JOIN GLMTPF T04 ON ((T01.GEN, T01.SUB) = (T0
21 4.GEN, T04.SUB)) JOIN FLDMPF T05 ON (T02.FIELDN = T05.FIELDN) LEFT OUTER JOIN AF
22 DCPF T06 ON (T01.PRPRTY = T06.PRPRTY); RENAME VIEW VWACTDTL TO ACCOUNT_DETAIL_VI
23 EW FOR SYSTEM NAME VWACTDTL; LABEL ON TABLE VWACTDTL IS 'GLDTPF, WLDDPF, NMA1PF,
24 GLMTPF, FLDMPF, AFDCPF'; LABEL ON COLUMN VWACTDTL ( DESCRIPTION_MORE IS 'MORE D
25 ESCRIPTION' ); LABEL ON COLUMN VWACTDTL ( DESCRIPTION_MORE TEXT IS 'MORE DESCRIP
26 TION' );
* * * * * E N D O F S O U R C E * * * * *
S1 V7R3M0 160422 Run SQL Statements VWACTDTL
d *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
D SEV RECORD TEXT
51 0 1 Position 1 View VWACTDTL created in Z_PD2087.
04 30 22 Position 52 Token VWACTDTL was not valid. Valid tokens: TO.​​​
Dale Asher's profile image
ROCKETEER Dale Asher
Hi David, 
I chatted L3 for LMi and they confirmed this should not be an issue.  In addition, my older example using 'rename' sent you up the wrong tree.   "...rename is not necessary...original SQL should work if defined 'correctly' to LMi. When adding to LMi, the “long name” should be on the first page and the system name should be on the second.  Need to display attributes to confirm".
If you take option 8, you should see the long and system (Associated *FILE) names known to LMi.  Example here from the demo apps installed in LMI
Object . . . . . . . . : VIEW_LONG_NSRC
Type . . . . . . . . . : *VIEW
Associated *FILE name : VIEWLONGN
Release . . . . . . . : ALDON/LMIDEMO/BASE
If they don't match the source create options for long and system, we won't find the object after it's created (not found).  If the naming for the object in LMi is not what you are intending, back up the source, delete the object and then add it again with the long and system names that you are intending to use.
If this doesn't sort the issue, pls open a support case and we'll work through this with you to resolve.
Best,
d
David Taylor's profile image
David Taylor
Thanks, @Dale Asher. That worked.  I simple need to learn the parlez Aldon. ​