On 1/20/2017 6:08 PM, Dan wrote:
The problem with Run SQL Scripts is that you have to remember to manually
save each statement you want to save. There is no automatic logging
function like you have with interactive SQL.
I abandoned the green screen SQL thinger years ago, and haven't
regretted it. For me, one of the major advantages to Run SQL Scripts is
the ability to save and organise me SQL. I keep all my SQL scripts on
the IFS, where I can get to them over the VPN. I have set ACS to be the
default for .SQL files, so opening Windows File Explorer and double
clicking 'restarts' a session.
I tend to store my scripts by 'project'. So I have all of the DDL to
create tables, views, indexes all in one place. One change to 'set
schema' and I can re-run the whole thing and put it into the production
library. In the same .sql file, I'll also put DML to load tables, query
results, test stored procs, etc. I find this infinitely better than the
primitive way the green screen stores SQL by display session.
Colleagues like to store their SQL by table. So they have the CREATE
TABLE, CREATE VIEW, CREATE INDEX, etc all in one place, with one .sql
file per DB2 table. All of this can be stored in a hierarchy of
folders, by DB2 library, etc.
Best: These IFS .sql files are part of my daily backup, and I can (and
have) restored them. From time to time. :-) I can also use Git on
them, as well as Dropbox and other cloud services.
As an Amazon Associate we earn from qualifying purchases.