× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

a view is a permanent object that can be used in all SQL interfaces and even
with native I/O (if no predefined sequence is expected).
That means create a view for a specific function (for example data for a
picking list) and give it the RPG programmer, the JAVA Guy, the PHP guy, the
Query/400 user and the guy who download their data into excel. Everybody
uses the same view. If it changes simply change the view and all programs
and queries will run correctly (even without recompiling, if you use
embedded SQL and do not Specify select *).

A view not only allows you to reduce source code, it also makes testing
easier.
Assumed you have a very complex SQL statement and you need to debug your
program. You have to copy and paste the SQL statement into either STRSQL or
iNavigator's Run an SQL script and test it. When using a view instead you
simply execute an SQL statement on the view.

BTW a view can be used like a table or physical file in an SQL-Statement.
You even can specify a view when creating another view.
And because a view never has a key, you can have as much views as you want
on your system without performance decrease. In this way it makes no sense
to temporary create views.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von David FOXWELL
Gesendet: Tuesday, 04. November 2008 09:35
An: Midrange Systems Technical Discussion
Betreff: SQL View

Hi,

Unfortunately we are not ready to have views on our system. In a test, I
created a view on 3 PF, called it, for example, articles, and then in my
program was able to run "Select info from articles".

As I cannot keep the view, my final select statement will have to be a lot
more complex.

I'd like to know, does a view do anything more than simplify an otherwise
complex request? Would it be reasonable in my case to create the view at the
start of my program and then drop it at the end?

Thanks

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.