Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CREATING VIEWS HEADACHE

Posted on 2006-07-11
6
Medium Priority
?
3,229 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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