View Full Version : Indexing an SQL View?
K.Forsythe
01-02-2004, 11:12 AM
You cannot put an order by keyword on a create View command. But the select statement can do teh order by. However, since you don;t want to use the select statement, consider creating an index and then referencing the index in your F specs. As a general rule of thumb, I suggest that you either use SQL or not. Don't go halfway it complicates your life. If you want to build the tables with SQL, process them with SQL. If not, stick with RPG. Good luck! Kevin
Guest.Visitor
01-06-2004, 07:42 AM
Apologize if this has been asked, but I cant seem to find the answer. Either this cant be done or I'm missing something obvious. Is there a way to build an SQL view that has a keyed index? Specifically, I was hoping to build an RPGIV program that would build work files using SQL's CREATE TABLE and CREATE VIEW. I need a view that selects specifics records based on field tests and also have a keyed sequence applied. I'd like to avoid declaring a select and using FETCH. My application would need to keep reapplying the select and I feel this will impact my performance. Any suggestions on how this can be accomplished? Thanks for any input.
Guest.Visitor
01-06-2004, 07:42 AM
Thanks for the reply, Kevin. Thats what I was afraid of. All the research I was doing was telling me an "order by" couldnt be applied to a view. Was hoping I was missing something simple. Guess I will go back to the good old F spec. Thanks again
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.