?
Solved

CREATING VIEWS HEADACHE

Posted on 2006-07-11
6
Medium Priority
?
3,107 Views
Last Modified: 2008-01-09
Hello,

I am tryigng to create views in IBM DB2, but I keep getting error msg;-

[IBM][CLI Driver][DB2/NT] SQL0153N  The statement does not
include a required column list.  SQLSTATE=42908

what exactly does this error mean, and I do I eliminate the cause.

Thank you

0
Comment
Question by:claracruz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 14

Expert Comment

by:sathyagiri
ID: 17087714
SQL0153N The CREATE VIEW statement or
common table expression does not
include a column list.
Explanation: A column list must be specified in
a CREATE VIEW statement or a common table
expression when:
v any element of the SELECT list in the fullselect
is other than a column name and is not named
using the AS clause
v any two elements are the same column name
that were not renamed using the AS clause.
The statement cannot be processed. For a
CREATE VIEW statement, the view was not
created.
User Response: Provide a column name list in
the CREATE VIEW statement or common table
expression or name the columns in the SELECT
list of the fullselect using the AS clause.
sqlcode: -153
0
 
LVL 14

Expert Comment

by:sathyagiri
ID: 17087719
Post your create view statement here
0
 
LVL 4

Author Comment

by:claracruz
ID: 17088084
CREATE VIEW VEHICLEDETAILSVIEW AS SELECT
V.VEHICLEID,
V.BARCODE,
V.DATECREATED,
V.DATEONSITE, V.DATELEFTSITE,
V.REGNUMBER,
V.NOKEEPERS,
V.MAKE,
V.MODEL,
V.DOORPLAN, V.TRANSMISSION,
V.FUELTYPE,
V.COLOUR,
V.ENGINESIZE,
V.DATEOFREGISTRATION, V.VIN,
V.METALLICPAINT,
V.MILEAGE,
V.MILEAGECORRECT,
V.VATABLEFLAG, V.WARRANTY,
V.LOGBOOK,
V.SERVICEHISTORYID,
V.SERVICEPRINTOUT,
V.COLLECTIONJOBID, V.DELIVERYJOBID,
V.VEHICLESTEREOID,
V.REDKEY,
V.TAX,
V.TAXEXPIRYDATE, V.COMMENTS,
V.VENDORCUSTOMERID,
V.VEHICLESTATUSID,
V.VEHICLELOCATIONID, V.VEHICLESITEID,
V.DISPLAYLOTNO,
V.SPARE1,
V.NONRUNNER,
V.ALLOYWHEELS, V.INTERNETLOTNO,
V.PLATETRANSFERFLAG,
V.CAPCODE,
V.CAPVALUERETAIL,
V.CAPVALUECLEAN, V.CAPVALUEAVERAGE,
V.CAPVALUEBELAVERAGE,
V.GLASS,
V.STANDINGVALUE,
V.CAPCONDITIONID, V.CREATETIME,
V.CREATEUSER,
V.UPDATETIME,
V.UPDATEUSER,
V.CAPVALUATIONDATE, V.CAPREGYEAR,
V.CAPREGLETTER,
V.CAPMILES,
V.CAPMAKE,
V.CAPMODEL, V.HPIMAKE,
V.HPIMODEL,
V.VEHICLETYPEID,
V.VEHICLEMOTID,
V.ELECTRICWINDOWSID, V.SATNAV,
V.STARTCODE,
V.LEATHERSEATS,
V.NUMBEROFSEATS,
V.SUNROOF, V.AIRCONDITIONING,
V.POWERSTEERING,
V.SIGNWRITTEN,
V.MOTEXPIRYDATE,
V.ONSITEFLAG, V.REGLETTER,
V.CAPVALUATIONMSG,
V.CAPVALUATIONTIME,
V.CHASSISNUMBER,
PMAUSER.VEHICLEELECTRICWINDOWS.VEHICLEELECTRICWINDOWSID,
PMAUSER.VEHICLEELECTRICWINDOWS.DESCRIPTION AS ELECTRICWINDOWS_DESCRIPTION,
PMAUSER.VEHICLELOGBOOK.VEHICLELOGBOOKID,
PMAUSER.VEHICLELOGBOOK.DESCRIPTION AS LOGBOOK_DESCRIPTION,
PMAUSER.VEHICLEMOT.VEHICLEMOTID,  
PMAUSER.VEHICLEMOT.DESCRIPTION AS MOT_DESCRIPTION,
PMAUSER.VEHICLESTEREO.VEHICLESTEREOID,
PMAUSER.VEHICLESTEREO.DESCRIPTION AS STEREO_DESCRIPTION,
PMAUSER.VEHICLETYPE.VEHICLETYPEID,
PMAUSER.VEHICLETYPE.DESCRIPTION AS VEHICLETYPE_DESCRIPTION,
PMAUSER.VEHICLESTATUSLIST.VEHICLESTATUSLISTID,
PMAUSER.VEHICLESTATUSLIST.DESCRIPTION AS VEHICLETYPE_DESCRIPTION,
PMAUSER.LOT.LOTID,
PMAUSER.LOT.AUCTIONSCHEDULEID,
PMAUSER.LOT.VEHICLEID,
PMAUSER.LOT.STATUSID,
PMAUSER.LOT.VEHICLEOUTINGREASONTYPEID,
PMAUSER.LOT.DATECREATED,
PMAUSER.LOT.DISPLAYLOTNO,
PMAUSER.LOT.DISPLAYRESERVEPRICE,
PMAUSER.LOT.HIGHESTBID,
PMAUSER.LOT.SALEPRICE,
PMAUSER.LOT.DATESOLD,
PMAUSER.LOT.PROVISIONALSALEFLAG,
PMAUSER.LOT.CAPCODE,
PMAUSER.LOT.RESERVEPRICE,
PMAUSER.LOT.CAPREGYEAR,
PMAUSER.LOT.CAPREGLETTER,
PMAUSER.LOT.CAPMILES,
PMAUSER.LOT.CAPVALUATIONDATE,
PMAUSER.LOT.CAPVALUERETAIL,
PMAUSER.LOT.CAPVALUECLEAN,
PMAUSER.LOT.CAPVALUEAVERAGE,
PMAUSER.LOT.CAPVALUEBELOWAVERAGE,
PMAUSER.LOT.CREATETIME,
PMAUSER.LOT.CREATEUSER,
PMAUSER.LOT.UPDATEUSER,
PMAUSER.LOT.UPDATETIME,
PMAUSER.LOT.SALEVATRATE,
PMAUSER.LOT.CAPVALUATIONMSG,
PMAUSER.LOT.CAPVALUATIONTIME,
PMAUSER.AUCTIONSCHEDULE.AUCTIONSCHEDULEID,
PMAUSER.AUCTIONSCHEDULE.SALELOCATIONID,
PMAUSER.AUCTIONSCHEDULE.SALETIME AS STARTTIME,
PMAUSER.AUCTIONSCHEDULE.ENDTIME AS ENDTIME,
PMAUSER.AUCTIONSCHEDULE.AUCTIONSCHEDULEREF,
PMAUSER.AUCTIONSCHEDULE.AUCTIONTYPEID
FROM PMAUSER.VEHICLE AS V
LEFT JOIN PMAUSER.VEHICLEELECTRICWINDOWS ON PMAUSER.VEHICLEELECTRICWINDOWS.VEHICLEELECTRICWINDOWSID =  V.ELECTRICWINDOWSID
LEFT JOIN PMAUSER.VEHICLELOGBOOK ON PMAUSER.VEHICLELOGBOOK.VEHICLELOGBOOKID =  V.LOGBOOK
LEFT JOIN PMAUSER.VEHICLEMOT ON PMAUSER.VEHICLEMOT.VEHICLEMOTID =  V.VEHICLEMOTID
LEFT JOIN PMAUSER.VEHICLESTEREO ON PMAUSER.VEHICLESTEREO.VEHICLESTEREOID =  V.VEHICLESTEREOID
LEFT JOIN PMAUSER.VEHICLETYPE ON PMAUSER.VEHICLETYPE.VEHICLETYPEID =  V.VEHICLETYPEID
LEFT JOIN PMAUSER.VEHICLESTATUSLIST ON PMAUSER.VEHICLESTATUSLIST.VEHICLESTATUSLISTID =  V.VEHICLESTATUSLISTID
LEFT JOIN PMAUSER.LOT ON PMAUSER.LOT.VEHICLEID =  V.VEHICLEID  
LEFT JOIN PMAUSER.AUCTIONSCHEDULE ON PMAUSER.AUCTIONSCHEDULE.AUCTIONSCHEDULEID = PMAUSER.LOT.AUCTIONSCHEDULEID
LEFT OUTER JOIN ZAGDB2AP.BIDS ON ZAGDB2AP.BIDS.VEHICLEID =  V.VEHICLEID
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 50

Accepted Solution

by:
Lowfatspread earned 2000 total points
ID: 17088317
you have

PMAUSER.VEHICLETYPE.DESCRIPTION AS VEHICLETYPE_DESCRIPTION, <---
PMAUSER.VEHICLESTATUSLIST.VEHICLESTATUSLISTID,
PMAUSER.VEHICLESTATUSLIST.DESCRIPTION AS VEHICLETYPE_DESCRIPTION  <----
you may have other duplicates...

try...

CREATE VIEW VEHICLEDETAILSVIEW AS SELECT
V.VEHICLEID,
V.BARCODE,
V.DATECREATED,
V.DATEONSITE, V.DATELEFTSITE,
V.REGNUMBER,
V.NOKEEPERS,
V.MAKE,
V.MODEL,
V.DOORPLAN, V.TRANSMISSION,
V.FUELTYPE,
V.COLOUR,
V.ENGINESIZE,
V.DATEOFREGISTRATION, V.VIN,
V.METALLICPAINT,
V.MILEAGE,
V.MILEAGECORRECT,
V.VATABLEFLAG, V.WARRANTY,
V.LOGBOOK,
V.SERVICEHISTORYID,
V.SERVICEPRINTOUT,
V.COLLECTIONJOBID, V.DELIVERYJOBID,
V.VEHICLESTEREOID,
V.REDKEY,
V.TAX,
V.TAXEXPIRYDATE, V.COMMENTS,
V.VENDORCUSTOMERID,
V.VEHICLESTATUSID,
V.VEHICLELOCATIONID, V.VEHICLESITEID,
V.DISPLAYLOTNO,
V.SPARE1,
V.NONRUNNER,
V.ALLOYWHEELS, V.INTERNETLOTNO,
V.PLATETRANSFERFLAG,
V.CAPCODE,
V.CAPVALUERETAIL,
V.CAPVALUECLEAN, V.CAPVALUEAVERAGE,
V.CAPVALUEBELAVERAGE,
V.GLASS,
V.STANDINGVALUE,
V.CAPCONDITIONID, V.CREATETIME,
V.CREATEUSER,
V.UPDATETIME,
V.UPDATEUSER,
V.CAPVALUATIONDATE, V.CAPREGYEAR,
V.CAPREGLETTER,
V.CAPMILES,
V.CAPMAKE,
V.CAPMODEL, V.HPIMAKE,
V.HPIMODEL,
V.VEHICLETYPEID,
V.VEHICLEMOTID,
V.ELECTRICWINDOWSID, V.SATNAV,
V.STARTCODE,
V.LEATHERSEATS,
V.NUMBEROFSEATS,
V.SUNROOF, V.AIRCONDITIONING,
V.POWERSTEERING,
V.SIGNWRITTEN,
V.MOTEXPIRYDATE,
V.ONSITEFLAG, V.REGLETTER,
V.CAPVALUATIONMSG,
V.CAPVALUATIONTIME,
V.CHASSISNUMBER,
EW.VEHICLEELECTRICWINDOWSID,
EW.DESCRIPTION AS ELECTRICWINDOWS_DESCRIPTION,
LB.VEHICLELOGBOOKID,
LB.DESCRIPTION AS LOGBOOK_DESCRIPTION,
MOT.VEHICLEMOTID,  
MOT.DESCRIPTION AS MOT_DESCRIPTION,
S.VEHICLESTEREOID,
S.DESCRIPTION AS STEREO_DESCRIPTION,
VT.VEHICLETYPEID,
VT.DESCRIPTION AS VEHICLETYPE_DESCRIPTION,
VS.VEHICLESTATUSLISTID,
VS.DESCRIPTION AS VEHICLESTATUS_DESCRIPTION,
L.LOTID,
L.AUCTIONSCHEDULEID,
L.VEHICLEID,
L.STATUSID,
L.VEHICLEOUTINGREASONTYPEID,
L.DATECREATED,
L.DISPLAYLOTNO,
L.DISPLAYRESERVEPRICE,
L.HIGHESTBID,
L.SALEPRICE,
L.DATESOLD,
L.PROVISIONALSALEFLAG,
L.CAPCODE,
L.RESERVEPRICE,
L.CAPREGYEAR,
L.CAPREGLETTER,
L.CAPMILES,
L.CAPVALUATIONDATE,
L.CAPVALUERETAIL,
L.CAPVALUECLEAN,
L.CAPVALUEAVERAGE,
L.CAPVALUEBELOWAVERAGE,
L.CREATETIME,
L.CREATEUSER,
L.UPDATEUSER,
L.UPDATETIME,
L.SALEVATRATE,
L.CAPVALUATIONMSG,
L.CAPVALUATIONTIME,
A.AUCTIONSCHEDULEID,
A.SALELOCATIONID,
A.SALETIME AS STARTTIME,
A.ENDTIME AS ENDTIME,
A.AUCTIONSCHEDULEREF,
A.AUCTIONTYPEID
FROM PMAUSER.VEHICLE AS V
LEFT JOIN PMAUSER.VEHICLEELECTRICWINDOWS as EW
  ON EW.VEHICLEELECTRICWINDOWSID =  V.ELECTRICWINDOWSID
LEFT JOIN PMAUSER.VEHICLELOGBOOK as LB
  ON LB.VEHICLELOGBOOKID =  V.LOGBOOK
LEFT JOIN PMAUSER.VEHICLEMOT as MOT
  ON MOT.VEHICLEMOTID =  V.VEHICLEMOTID
LEFT JOIN PMAUSER.VEHICLESTEREO as S
  ON S.VEHICLESTEREOID =  V.VEHICLESTEREOID
LEFT JOIN PMAUSER.VEHICLETYPE as VT
  ON VT.VEHICLETYPEID =  V.VEHICLETYPEID
LEFT JOIN PMAUSER.VEHICLESTATUSLIST as VS
  ON VS.VEHICLESTATUSLISTID =  V.VEHICLESTATUSLISTID
LEFT JOIN PMAUSER.LOT as L
  ON L.VEHICLEID =  V.VEHICLEID  
LEFT JOIN PMAUSER.AUCTIONSCHEDULE as A
  ON A.AUCTIONSCHEDULEID = L.AUCTIONSCHEDULEID
LEFT OUTER JOIN ZAGDB2AP.BIDS
  ON ZAGDB2AP.BIDS.VEHICLEID =  V.VEHICLEID
0
 
LVL 4

Author Comment

by:claracruz
ID: 17088455
SAME ERROR, so is the error occuring because there may be duplication output names?
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 17088599
yes thats a good probably cause...

you've got an L and a V vehicleid...



0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question