How can I see SQL VIEW inside ?

20 pts.
Tags:
AS/400 SQL View
Logical Files
SQL View
SQLVIEW AS/400
Dear Friend, I see the VIEWS on AS/400 as logical file,but I don't know wit which SQL it is created. How can I see the SQL Sentence of this VIEW ?

Software/Hardware used:
AS/400
ASKED: November 4, 2010  1:32 PM
UPDATED: November 9, 2010  7:10 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • cheeze33
    Also you can use iseries Navigator to generate the SQL used to create the View.
    145 pointsBadges:
    report
  • TomLiotta
    ...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
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following