ERROR at line 1: ORA-06550: line 1, column 7: PLS-00905: object NMPKG.sp_s_DetailFreightReport is invalid ORA-06550: line, column 7: PL/SQL: Statement ignored CREATE OR REPLACE PROCEDURE sp_s_DetailFreightReport ( STORE_NO IN VARCHAR2(10), FROM_DATE IN VARCHAR2(10), TO_DATE IN VARCHAR2(10)) IS BEGIN SELECT PM.SEND_FREQ_ADDR.NAME, SN.IDATA_SHIPMENTS.CARRIER, SN.IDATA_SHIPMENTS.PO_NUM, SN.IDATA_SHIPMENTS.S2NAME1, SN.IDATA_SHIPMENTS.S2ADD1, SN.IDATA_SHIPMENTS.S2ZIP, SN.IDATA_SHIPMENTS.FLEX41 FROM PM.SEND_FREQ_ADDR, SN.IDATA_SHIPMENTS WHERE PM.SEND_FREQ_ADDR.STORE_NO = STORE_NO AND SN.IDATA_SHIPMENTS.FLEX11 = PM.SEND_FREQ_ADDR.STORE_NO AND SN.IDATA_SHIPMENTS.SHIPDATE BETWEEN FROM_DATE AND TO_DATE ORDER BY SN.IDATA_SHIPMENTS.CARRIER, SN.IDATA_SHIPMENTS.PO_NUM END sp_s_DetailFreightReport; /
Any clues as to the cause of the error?
Secondly, a semi-colon is required at the end of your SQL statement in the procedure.
Finally, please note that this procedure does not do anything at this time, other than executing the SQL statement and getting the data into the defined variables. You need to manipulate the data or send it outside the procedure with out parameters.
Another note, in the procedure below I have used table aliases T1 and T2. There is no need to use This was first published in June 2004
CREATE OR REPLACE PROCEDURE sp_s_DetailFreightReport (
STORE_NO IN VARCHAR2(10),
FROM_DATE IN VARCHAR2(10),
TO_DATE IN VARCHAR2(10))
V_ CARRIER SN.IDATA_SHIPMENTS.CARRIER;
T1.STORE_NO = STORE_NO
AND T2.FLEX11 = T1.STORE_NO
AND T2.SHIPDATE BETWEEN FROM_DATE AND TO_DATE
This was first published in June 2004