Solved

CREATING VIEWS HEADACHE

Posted on 2006-07-11
6
2,999 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 50

Accepted Solution

by:
Lowfatspread earned 500 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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 …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

732 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