![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In Pervasive.SQL v7, I have not been able to create a VIEW that includes a CAST expression. I get Scalable SQL engine error #845. E.g., CREATE VIEW AS SELECT CAST( InvoiceDateString as DATE ) AS InvoiceDate from InvoiceHdr; The SELECT alone runs just fine in SQLScope. However, I think that the CREATE VIEW sees the "as" of the CAST function as specifying a column heading. The "AS" of the intended column heading would then appear to the Scalable SQL engine to create more column headings than there are columns in the SELECT statement, causing error #845: The number of column headings must match the number of columns in the view. How do I accomplish the above CREATE VIEW in v7 without the error? We are not in a position to move to v2000 at this point. Will appreciate any sincere help offered. Tim Farrar |
#3
| |||
| |||
|
|
Need to just use the right syntax. The CREATE VIEW statement needs a bit more in the header: CREATE VIEW MyTestView (InvoiceDate) AS SELECT CAST( InvoiceDateString as DATE ) from InvoiceHdr; This works just fine. BTW, I would not worry about moving to Pervasive.SQL 2000 at this point, since it is also no longer supported. Look at PSQLV8 instead... Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! Tim Farrar wrote: In Pervasive.SQL v7, I have not been able to create a VIEW that includes a CAST expression. I get Scalable SQL engine error #845. E.g., CREATE VIEW AS SELECT CAST( InvoiceDateString as DATE ) AS InvoiceDate from InvoiceHdr; The SELECT alone runs just fine in SQLScope. However, I think that the CREATE VIEW sees the "as" of the CAST function as specifying a column heading. The "AS" of the intended column heading would then appear to the Scalable SQL engine to create more column headings than there are columns in the SELECT statement, causing error #845: The number of column headings must match the number of columns in the view. How do I accomplish the above CREATE VIEW in v7 without the error? We are not in a position to move to v2000 at this point. Will appreciate any sincere help offered. Tim Farrar |
![]() |
| Thread Tools | |
| Display Modes | |
| |