Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / January 2007

Tip: Looking for answers? Try searching our database.

Creating SQL Views on AS400 v5r4

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kellyj00@gmail.com - 17 Jan 2007 22:56 GMT
Hello.

I'm new to the world of the as400, but not to the world of SQL and
relational databases.   I would like to create a view on our as400
machine, but I understand that creating a view will create some sort of
lock on any 'files' that our RPG code references so they cannot be
modified unless the view is invalidated and recompiled after the
changes are made.

Here's the real problem with this, when I create a view using Iseries
navigator, run SQL Script, create view my_view as (bow wow, woof woof)
The view "my_view" will not show up for the RPG programmers to be able
to gather source code and recompile...something they refer to as
"Function 14'ing" it, if that rings a bell to anyone.

How can I create a View with the basic SQL "create view" statement in
such a way that they can delete and recompile it as we need to modify
our table structure?

Thank you for your help and patience.
Jason
Karl Hanson - 17 Jan 2007 23:55 GMT
> Hello.
>
[quoted text clipped - 14 lines]
> such a way that they can delete and recompile it as we need to modify
> our table structure?

Not sure I follow the lock conflict you describe, but using iNav after
creating the view, drill down to the view under:
My Connections
  Databases
    <rdb>
      Schemas
        <schema>
          Views

Find your view in the list (right pane), right click on it and pick
Generate SQL.  In the new window make changes (if desired) and click the
Generate button.  From there you can do File-Save As, copy/paste, etc.

To do this programatically, see the Generate Data Definition Language
(QSQGNDDL) API:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/qsqg
nddl.htm


--
Karl Hanson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.