ALTER TABLE HA_ST01.TABLE_PO_SALES_MOM_TZC DROP COLUMN C_MONTH; CREATE procedure HA_ST01.PRO_PO_SALES_MOM_TZC(IN S_YM NVARCHAR(6),IN E_YM NVARCHAR(6)) LANGUAGE SQLSCRIPT AS BEGIN DELETE FROM HA_ST01.TABLE_PO_SALES_MOM_TZC WHERE C_MONTH BETWEEN :S_YM AND :E_YM; INSERT INTO TABLE_PO_SALES_MOM_TZC(C_MONTH,GROSSAMOUNT,GROSSAMOUNT_1,RATE_MOM)(SELECT C_MONTH FROM "_SYS_BIC"."HA20_TZC.DAY1/CAL_PO_TZC_01" WHERE C_MONTH BETWEEN :S_YM AND :E_YM); END;怎么修改
时间: 2023-07-22 19:14:59 浏览: 78
oracle_sql_01_create_drop_alter_insert_delete_update.sql
根据提供的代码,您需要将INSERT INTO语句中的表名从TABLE_PO_SALES_MOM_TZC修改为HA_ST01.TABLE_PO_SALES_MOM_TZC,以便与DELETE语句中的表名匹配。修改后的代码如下:
```
ALTER TABLE HA_ST01.TABLE_PO_SALES_MOM_TZC DROP COLUMN C_MONTH;
CREATE procedure HA_ST01.PRO_PO_SALES_MOM_TZC(IN S_YM NVARCHAR(6),IN E_YM NVARCHAR(6))
LANGUAGE SQLSCRIPT AS
BEGIN
DELETE FROM HA_ST01.TABLE_PO_SALES_MOM_TZC WHERE C_MONTH BETWEEN :S_YM AND :E_YM;
INSERT INTO HA_ST01.TABLE_PO_SALES_MOM_TZC(C_MONTH,GROSSAMOUNT,GROSSAMOUNT_1,RATE_MOM)
(SELECT C_MONTH FROM "_SYS_BIC"."HA20_TZC.DAY1/CAL_PO_TZC_01" WHERE C_MONTH BETWEEN :S_YM AND :E_YM);
END;
```
请注意,如果表名或字段名有误,仍会提示错误。建议在修改代码之前,仔细检查表名、字段名和语法,以确保代码正确无误。
阅读全文