Using saved SQL files in DB2 for i #2377
Replies: 2 comments 3 replies
-
Here is something I've been trying lately to keep my SQL files at hand in VS Code regardless of which LPAR I'm connected to. In the GistPad view, you get a nice explorer to browse your Gist and organize them. You can even browse your starred Gist if you favorited Gists from other users. Give it a try, it may fit your need 😊 |
Beta Was this translation helpful? Give feedback.
-
@Gregory1701 , could you use three part naming? This way your statement stays virtually the same and all you have to change is the remote name. |
Beta Was this translation helpful? Give feedback.
-
In our distributed system, we have our home office IBM i, and then around 80 other IBM i's. I have various SQL files saved locally on my laptop. For organizational purposes, I keep them all in a folder called 'SQL Files' and each SQL file is named for the table(s) or subject matter of the SQL statements within each file.
In RSS within ACS, this is quite simple to be connected to one IBM i, open a SQL file, do some investigation, then leave that file open and connect to a different IBM i and run those statements again.
My first hurdle with adopting DB2 for i was that it wasn't easy to open a local file. I then, on my 'home office' IBM i, created a subdirectory within my default IFS directory called 'SQL Files' and copied all of my SQL files from my local folder to my new IFS subdirectory. Then in the IBM i extension, I created an IFS shortcut to my new 'SQL Files' subdirectory. This works great! When I want to open one, I can just go to my IFS Browser section within the IBM i extension, double click the one I want to open and it opens in a DB2 for i window and I'm 'off to the races'.
Now then, comes the trick. When I want to switch to one of my other 80 IBM i's, while I can setup (albeit a bit time consuming) a connection for each of those systems, it's not feasible to maintain those SQL files on all 80 systems. Any ideas how to solve this dilemma?
Beta Was this translation helpful? Give feedback.
All reactions