Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I have some db tables that it would be desireable to create a logical that is over a portion of the field.
Example, say you have zip code and address 1 and what you want is zip code + only 10 positions of the address.
Creating the tables in SQL (well in inav). Going to use in rpg. Can one do such?
With logical file DDS, yes. With SQL yes.
bob, would you like to expound on how you do that...
A R CUSTREC PFILE(CUSTMAST)
A ZIPCODE
A ADDR10 SST(ADDRESS 1 10)
In DB2 you can CREATE VIEW over the table(s) and define the data any way you want.
Note that the use of a DDS SST() field must be input-only (I) or neither (N); i.e., you can't update a SST() field. There are other interactions with other keywords and a few other things to be aware of (see the DDS reference for full details).