Create a view in DB2/400
10345 pts.
0
Q:
Create a view in DB2/400
I need an example to create a view in DB2/400.
I Need to create a view where the table name is greather than 8 characters and collumns names greather than 6 characters.
please somebody can help me??
ASKED: Sep 16 2008  3:09 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
275 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
If I understand your question correctly, on the AS400 you can use sql to create a file or logical view, or table, whatever you want to call it. The command is STRSQL to get into sql then the sql command to create a table is CREATE VIEW filename AS SELECT fieldnames etc. You will need to lookup sql commands but that is the basic command that will create a logical view of a physical file. I have one with a file name that is ten characters long and ten character long field names, since you asked about length
here is an example

CREATE VIEW filename AS SELECT field1 AS field1descriptivetext, COUNT(field2) AS field2descriptivetext FROM library.physicalfile GROUP BY fieldname
Last Answered: Sep 16 2008  3:35 PM GMT by Geekprime   275 pts.
Latest Contributors: Philpl1jb   24610 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Tjgm88   440 pts.  |   Sep 16 2008  11:15PM GMT

Hi,
You can create views on the AS400 using the CRTLF (Create Logical file) command. On this command you will need to supply the name of a source file which points to the physical file(data file) and describes the key sequence of the view. You need to crease the source file first using the STRPDM facility.
Cheers!

 
0