How to extract my table_names+descriptions from my "database navigator" from IBM?
I have a my database navigator that contains a lot of tables with descriptions. I need to search within descriptions in order to find the table I need, but in the database navigator from ibm this feature is not available. Because of th开发者_开发问答is I want to export all data to a excel sheet. But how?
This SQL statement will give you the schema (library), table name, and description for every table you have access to.
SELECT TABLE_SCHEMA, NAME, TABLE_TEXT
FROM QSYS2.SYSTABLES
You can get it into Excel in a few ways. I am not a big fan of iSeries Navigator, so I tend to use Microsoft Query to get my data into Excel.
Here's how I do it:
- Go to the Data ribbon (I'm on 2007)
- Select "From Other Sources"
- Select "From Microsoft Query"
- choose your data source and click OK
- Cancel out of the Query Wizard
- Answer "Yes" to the question "Do you want to continue editing this query in Microsoft Query?"
- Close out of the "Add Tables" dialog.
- Hit the SQL button on the tool bar (or choose "SQL..." from the "View" menu).
- Paste in the SQL statement and click OK.
- If "SQL Query can't be represented graphically. Continue anyway?" comes up, click OK.
- Choose "Return data to Microsoft Office Excel" from the "File" menu.
Yes, it's a klunky process, but it works. The only downside is that Microsoft Query runs the query to show it to you, the Excel runs it again to pull the data. That might not always be a good idea if it's an expensive query to run. I wouldn't worry about it in this case.
You can also do it the old fashioned way, if you have access to green screen and the command line.
Use WRKOBJPDM LIB(youiSerieaLibraryName) OBJTYPE(*FILE)
then use F17 Subset (Shift and F5 ) and enter your search criteria for the file description next to TEXT
精彩评论