Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unexpected token near *!* in the following... using cast in view

932936Mar 11 2013 — edited May 22 2013
All,

The following query works.

SELECT
TABLE1.FIELD1,
CAST(
TABLE2.FIELDMULTIPLIER2 *
CASE
WHEN TABLE1.FIELDCHECK=1
THEN TABLE1.FIELD2 * TABLE3.SOMETYPEOFDECIMAL
ELSE TABLE1.FIELD2
END AS NUMBER(17,7)) AS FIELD2,
CAST(
TABLE2.FIELDMULTIPLIER3 *
CASE
WHEN TABLE1.FIELDCHECK=1
THEN TABLE1.FIELD3 * TABLE3.SOMETYPEOFDECIMAL
ELSE TABLE1.FIELD3
END AS NUMBER(17,7)) AS FIELD3
FROM TABLE1
INNER JOIN TABLE2
ON TABLE1.FKTABLE2 = TABLE2.ID
INNER JOIN TABLE3
ON TABLE1.FKTABLE3 = TABLE3.ID.

However, when I try to put this into a View, I get an Unexpected token near *!* in the following: END AS NUMBER(17*!*,7)) AS FIELD2 and Unexpected token near *!* in the following: END AS NUMBER(17,7*!*)) AS FIELD2. The query executes fine, but when I test the syntax I get this error and the view doesn't compile.

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

Edited by: 929933 on Mar 11, 2013 5:18 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2013
Added on Mar 11 2013
3 comments
1,529 views