When you do the RUNSQLSTM to create your SQL Objects – Do not qualify library names but use the Turnover variables just like you would define PDM variables:
Turnover uses the DFTRDBCOL column “&LI” to populate the other *library* variables.
Most shops I’ve been to use QSQLSRC to store the SQL definitions then use RUNSQLSTM to “compile” the source. Make sure you use a semi colon between each SQL statement.
I prefer to break source out into separate files for each type:
NOTE: These alternate source file names are completely optional.
Source members are named and commented like any other source member. It’s neat — get in the habit. 😉
All code changes are promoted and managed by Turnover.
Remember, first use a DROP TABLE statement to drop the table (which deletes its data and its DB2 dependencies). Then a CREATE TABLE statement for all columns, including CONSTRAINTS (Primary Key, Foreign Key, CASCADE’s if any, etc.).
Our standards also then have a CREATE UNIQUE INDEX statement for the keys, to start off the QRYMGR in the right direction.
Dont forget to take advantage of ALTER – for those times that you don’t want to DROP and CREATE columns or attributes then use ALTER TABLE statements to add columns and/or attributes without killing the table or its data.
IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.
How to change a Files alternative name using IBM i SQL
AS400 Technical Interview Question and Answer – AS400 Database
What is a physical and logical file in the AS400 Database
How to Install IBM Access Client Solutions (ACS)
IBM i Data Obfuscation – Making Data Foggy Murky and Squinty
How to rename Fresche (BCD) Presto Library – XL_PRESTO
What is AS400 modernization?
IBM i ACS 5250 EMULATOR FONT – and other ridiculous mumbo jumbo
IBM i SQL statement to convert or compare hundred year date format