Solved

CREATING VIEWS HEADACHE

Posted on 2006-07-11
6
2,777 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
  • 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.csv files 5 78
SQL Insert Query Help, part2 6 42
SQL Update Query 23 78
oracle query help 18 77
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now