[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How retrieve a view from an SQL query on iSeries?

Posted on 2011-09-26
6
Medium Priority
?
583 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 35

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 35

Expert Comment

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

- Gary
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 35

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 35

Expert Comment

by:Gary Patterson
ID: 36600422
Happy to help.

- Gary
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 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