At 04:44 PM 11/16/2010, Bruce Chitiea wrote:
All:
Code:
PROJECT newtablename +
FROM anyview +
USING partno, part2order
Error message: "-ERROR- Illegal column name - part2order (2056)"
Table "newtablename" is not created.
alternately ...
PROJECT newtablename +
FROM anyview +
USING *
Error message: "-ERROR- Illegal column name - part2order (2056)"
Table "newtablename" is not created.
Column "partno" is TEXT
Column "part2order" is INTEGER
Table "newtablename" does not exist in the database.
Column "part2order" does not appear elsewhere in the database.
Have dropped and recreated "anyview", renamed "part2order".
Thoughts?
Bruce,
Very closely, take a look at the definition of your view.
Most likely, you will find a duplicate column names as t1.columnname,
and t2.columnname, etc.
To avoid such circumstances, use ALIAS names to correctly define a
unique column name that can be used when using the PROJECT command.
Example:
-- TransAmounts.vie
CONNECT RRBYW17
SET ERROR MESSAGE 677 OFF
DROP VIEW TransAmounts
SET ERROR MESSAGE 677 ON
CREATE VIEW `TransAmounts` +
(TranNum, Total) AS +
SELECT t2.TransID,SUM (t3.Price) +
FROM InvoiceHeader t2,InvoiceDetail t3 +
WHERE t3.TransID = t2.TransID +
GROUP BY t2.TransID +
UNION SELECT t1.TransID,$0.00 +
FROM InvoiceHeader t1 +
WHERE NOT EXISTS +
(SELECT TransID FROM InvoiceDetail +
WHERE InvoiceDetail.TransID = t1.TransID)
Hope that provides you with some blue's clues ...
Very Best R:egards,
Razzak.