Solved

How retrieve a view from an SQL query on iSeries?

Posted on 2011-09-26
6
513 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 34

Expert Comment

by:Gary Patterson
Comment Utility
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
Comment Utility
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 34

Expert Comment

by:Gary Patterson
Comment Utility
Drop the view and re-create it.

- Gary
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
Comment Utility
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
Comment Utility
Ahhh- thanks for the info Gary.

Very handy.

I appreciate it.

-Anthony
0
 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
Happy to help.

- Gary
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now