Re: Can I create an index on a view?




"Shirley" <smunoz@xxxxxxxxxxx> wrote in message
news:1147390524.565037.256790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
We are running DB2 on iSeries V5R2.
Using AQUA DATA STUDIO with a connection to our iSeries, I created a
view using SQL and I am trying to create an index on this view using
the code below.

CREATE INDEX reports.Ivendorname ON reports.transbyvendor05
(vendorname)

However I get the following error:

Error: [SQL0156] TRANSBYVENDOR05 in REPORTS not a table.

Is it possible to create an index on a view? If not, what other
options
do I have to improve
the performance of my queries on the view I created?
Thanks, Shirley..

No. although you can specify a view in the from clause of a select
statment and specify an order by clause.


.



Relevant Pages

  • Re: How do the records retrieve from data base when using sql statements?
    ... Just use an order by clause. ... guaranteed to be returned in the correct order in you don't specify an order ... SQL statement. ... This means that the keys are located continuously and every "insert" ...
    (comp.sys.ibm.as400.misc)
  • Re: Job Priority, QZDASOINIT
    ... If you have an index over PKSHIP and you are returning only a few records ... If you don't have an index over PKSHIP then SQL is going to do a table ... Paul Conte and Mike Cravitz have a book on SQL on the iSeries. ... clause instead of the WHERE clause. ...
    (comp.sys.ibm.as400.misc)
  • Re: SQL Anfrage zu Es existiert genau ein ....
    ... Wer hat dir denn diesen Unsinn erzählt? ... Specify a grouped table derived by the application of the <group by ... clause> to the result of the previously specified clause. ... The following restrictions apply for Intermediate SQL: ...
    (microsoft.public.de.sqlserver)
  • Re: Using an alias in the HAVING clause
    ... It seems I can't specify the alias in the WHERE clause or the ... But I can specify it in the ORDER BY clause. ... you can use a CTE and then query the CTE where you can ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (microsoft.public.sqlserver.programming)
  • Re: Journal receivers
    ... Journaling is optional on DB2 for iSeries. ... If a collection was created through SQL, ... Journaling is one on a per table (file in native iSeries parlance) basis. ... journal will be attached and, if you so specify, the old journal will be ...
    (comp.sys.ibm.as400.misc)