[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How retrieve a view from an SQL query on iSeries?

Posted on 2011-09-26
6
Medium Priority
?
592 Views
Last Modified: 2012-06-21
Hi everyone, I created an sql view on an iseries; however, I don't know how to view it and see the results.

I created the sql using strsql and then going through the prompts.  I know the view is there, because I can drop it- but I can't see it.

Can someone help me, I've a 400 novice.
0
Comment
Question by:Anthony6890
  • 4
  • 2
6 Comments
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 36599531
You use a view in a SELECT query just like you would use a table:
 
strsql
select * from yourviewnamegoeshere

- Gary Patterson
0
 
LVL 1

Author Comment

by:Anthony6890
ID: 36599843
Hey Gary,

Thanks for the help yet again.  How do I alter that view?  I ask because when I run that command for my query, I get this error:  Selection error involving field *N.

I would assume it has something to do with my query criteria.  
0
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 36600079
Drop the view and re-create it.

- Gary
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 36

Accepted Solution

by:
Gary Patterson earned 2000 total points
ID: 36600150
Before you create a view, test the SELECT clause by executing it and verifying that it works.  Once you have a working SELECT statement, stick the CREATE VIEW clause in front of it:

Get the SELECT working first:

        SELECT LASTNAME, WORKDEPT FROM  CORPDATA.EMPLOYEE
        WHERE JOB = 'MANAGER'

Once you have the bugs out and it works, then insert the CREATE VIEW clause:

CREATE VIEW CORPDATA.EMP_MANAGERS AS
        SELECT LASTNAME, WORKDEPT FROM  CORPDATA.EMPLOYEE
        WHERE JOB = 'MANAGER'

In STRSQL, you can use F9 and F10 to pull down and edit previous statements.

- Gary Patterson
0
 
LVL 1

Author Comment

by:Anthony6890
ID: 36600408
Ahhh- thanks for the info Gary.

Very handy.

I appreciate it.

-Anthony
0
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 36600422
Happy to help.

- Gary
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Will the future of mobile app development include the same trends as those most relevant today? Find out by checking out the 7 trends of the future.
Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question