Chuck,
I appreciate your recommendations on a more complete style;
brevity may be the 'soul of wit' but for clarity and maintainability
it may not be a hit.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Friday, August 23, 2013 3:44 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: View to create a PF?
On 23 Aug 2013 06:18, Hoteltravelfundotcom wrote:
How do you refer to a Temp table on the i? this is not accepted:
SELECT *
INTO astccdta.#acbalmpk
FROM
(
SELECT LMLTPC
, COALESCE(IRLOC1,'') as IRLOC1
, COALESCE(IRLOC2,'') as IRLOC2
, COALESCE(IRLOC3,'') as IRLOC3
, IRPRT#
, IRQOH#
, IRWHS#
, '' as IEPRT#
, '.00' as IEQOH#
, '' as IELOC1
... /* <ed> indicate continuation */
) AS c_name /* <ed> concluded as one table-reference */
Somewhat moot to reply to this message because the direction of the issue since was put in the correct trajectory, but still I offer:
The "SELECT ... INTO" syntax is not what is desired there; others have already explained. The intention appears instead, to be to effect an INSERT INTO statement.
The table-reference as an implied temporary table [as a derived table expression, in parentheses, aka Nested Table Expression (NTE); although per query rewrite, may not be implemented as a temp table] is properly written; albeit I added the ellipses, the closing parenthesis, and the AS correlation-name to make the reference appear more complete. The table-expression optionally could be preceded by the keyword TABLE or LATERAL to provide emphasis or to change the available scoping of correlated names if required.
--
Regards, Chuck
--
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.