Error(11,15): PL/SQL: ORA-04044: procedure, function, package, or type is not allowed here
20,193
DATE
is a reserved keyword in Oracle. Your procedure shouldn't even compile if it contained the insert statement you posted. If you're going to use DATE for a table name, put it in quotes:
INNER JOIN "DATE" ON X.DATE_NUM="DATE".DATE_NUM
Author by
user663354
Updated on July 01, 2020Comments
-
user663354 almost 4 years
I am trying to get data from 4 tables FACTS_CDPM, PRODUCT, CUSTOMER, DATE into CUST_ALLOC table, when I just run the select query, i get the result, but when I put it inside a procedure and do an insert into with the select statement as below, I get an error "Error(11,15): PL/SQL: ORA-04044: procedure, function, package, or type is not allowed here"
Please can somebody help as to why this is happening?
Thank you!
INSERT INTO CUST_ALLOC (PART_ID, CUSTOMER, MONTH, QTY_ALLOCATED ) SELECT P.PROD_ID, C.PURCHASING, D.MONTH_ID, SUM(X.QTY) FROM FACTS_CDPM X INNER JOIN PRODUCT P ON P.PROD_NUM=X.PROD_NUM INNER JOIN CUSTOMER C ON X.CUST_NUM=C.CUST_NUM INNER JOIN DATE D ON X.DATE_NUM=D.DATE_NUM WHERE MEASURE_NUM=18 GROUP BY P.PROD_ID,C.PURCHASING,D.MONTH_ID;