Simplest might be to use the DSPFD command. A SQL VIEW will show the related CREATE VIEW statement in the file description.
If the definition is needed in SQL itself, you can possibly query the SYSVIEWS table in QSYS2. A more standard way might be to query VIEWS in the SYSIBM library.
Tom
thank you very much
Last Wiki Answer Submitted: November 8, 2010 4:22 pm by TomLiotta108,105 pts.
All Answer Wiki Contributors: TomLiotta108,105 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
A SQL VIEW is implemented as a derivative type of logical file on AS/400s. But not all logical files are SQL VIEWs. A logical file might not have been created with SQL — there might be no SQL statement to see.
Assuming that SQL was used to create the LF, what comes out should be effectively what went in. You can test that by viewing the ‘Query Text’ tab of the Definition context-menu item.
But if SQL wasn’t used, you’ll only get the nearest approximation.
Also, are you sure that these are SQL VIEWs?
A SQL VIEW is implemented as a derivative type of logical file on AS/400s. But not all logical files are SQL VIEWs. A logical file might not have been created with SQL — there might be no SQL statement to see.
Tom
Also you can use iseries Navigator to generate the SQL used to create the View.
…the SQL used to create the View.
Assuming that SQL was used to create the LF, what comes out should be effectively what went in. You can test that by viewing the ‘Query Text’ tab of the Definition context-menu item.
But if SQL wasn’t used, you’ll only get the nearest approximation.
Tom