× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Check out the explanation of SQL0153. What does it say? As a hint, your
sum() column does not have a name, so you'll have to name it with an 'AS'
clause.



SQL0153
SQL0153N
The statement does not include a required column list.
Explanation:


A column list must be specified in a CREATE VIEW statement, a common table
expression or in a CREATE TABLE statement containing an as-subquery-clause
when:
any element of the SELECT list in the fullselect is other than a
column name and is not named using the AS clause.
any two elements are the same column name that were not renamed using
the AS clause.


The statement cannot be processed.


User response:


Provide a column name list in the CREATE VIEW statement, common table
expression, CREATE TABLE statement, or name the columns in the SELECT list
of the fullselect using the AS clause.


sqlcode: -153


sqlstate: 42908




From: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 12/09/2015 11:03 AM
Subject: Re: This small query not compiling
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



this is strange thing now.. OEINDLID is a PF.

this select works
select idord#, idprt#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE
idprt# not
like 'FRT%' AND iddocd > 20150930
group by idord#, idprt#

but when trying to create a view of this

CREATE VIEW ordamtno as
select idord#, idprt#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE
idprt# not
like 'FRT%' AND iddocd > 20150930
group by idord#, idprt#

i get error sql 0153 column list required.

what do i need to put here?


On Wed, Dec 9, 2015 at 9:36 AM, Hoteltravelfundotcom <
hoteltravelfun@xxxxxxxxx> wrote:

yes Darren, it was the case.!

On Wed, Dec 9, 2015 at 9:24 AM, <darren@xxxxxxxxx> wrote:

Make sure you're paying attention to the case. For example, is it FRT
or
frt? Also, you might want to wildcard the beginning. Here is a safe
bet,
although it might be overkill:

select idord#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE upper
(idprt#) not
like '%FRT%' AND iddocd > 20150930
group by idord#



From: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 12/09/2015 09:20 AM
Subject: Re: This small query not compiling
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



I see but its not doing the select clause
its selecting all the parts.

we want to see the order amt without the freight. because the sales
commissions dont apply to freight rows. so can this still be done?

select idord#, sum(idshp# * idntu$) from astdta.OEINDLID WHERE idprt#
not
like 'frt%' AND iddocd > 20150930
group by idord#


On Wed, Dec 9, 2015 at 9:01 AM, Paul Nelson <nelsonp@xxxxxxxxxxxxx>
wrote:

Attending COMMON is also a good idea.

Paul Nelson
Cell 708-670-6978
Office 409-267-4027
nelsonp@xxxxxxxxxxxxx


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
rob@xxxxxxxxx
Sent: Wednesday, December 09, 2015 7:22 AM
To: Midrange Systems Technical Discussion
Subject: Re: This small query not compiling

You're getting better; you've enclosed the offending message id.
Great.
Now, if you read that message further you will see
DSPMSGD RANGE(SQL0122) MSGF(QSQLMSG)
1. Display message text
-- The statement contains column name &1 and an aggregate function
in
the
SELECT clause and no GROUP BY clause is specified.
...

But it's the first one. You cannot put a column in a select when you
have
an aggregate function like SUM, without doing a control break on that
selected column. In SQL a control break is done with GROUP BY.

Still gotta recommend reading a getting started with sql type book.
Like
http://amazon.midrange.com
SQL/400 Developer's Guide (Vol 2)Sep 2000
by Mike Cravitz and Paul Conte
Old but a great start.
Selling for as low as $7.32


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxx>
Date: 12/09/2015 07:55 AM
Subject: This small query not compiling
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



select idord#, sum(idshp# * idntu$) from astdta.oeind2 WHERE idprt#
not
like 'frt%' AND iddocd > 20150930

am getting error,

SQL0122 - Column IDORD# or expression in SELECT list not valid. what
is
wrong here in the syntax?
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.