程序问题
create or replace
PROCEDURE XXB_RJT_HEADER_PROCEURE
(
V_PROD_ID IN NUMBER,
V_WARE_ID IN XXB_RJT_HEADER.WAREHOUSE_ID% TYPE,
V_PAY_METH IN XXB_RJT_HEADER.PAYMENT_METHOD% TYPE,
V_PAY_STAT IN XXB_RJT_HEADER.PAYMENT_STATUS% TYPE,
V_ORD_ID IN XXB_RJT_HEADER.ORDER_ID% TYPE,
V_ORD_DT IN XXB_RJT_HEADER.ORDER_DATE% TYPE )
AS
V_PROD_NM VARCHAR2(50);
V_WAR_NM VARCHAR2(15);
BEGIN
SELECT PRODUCT_CAT
INTO V_PROD_NM
FROM xxb_rjt_inventory
WHERE XXB_RJT_INVENTORY.product_id= V_prod_id;
SELECT WAREHOUSE_NAME
INTO V_WAR_NM
FROM xxb_rjt_inventory
WHERE XXB_RJT_INVENTORY.product_id= V_prod_id;
INSERT
INTO XXB_RJT_HEADER
( /*second error*/
warehouse_id,
PAYMENT_METHOD,
payment_status,
product_name,
order_id,
wareshouse_name,
order_date
)
VALUES
(
V_warehouse_id,
v_pay_meth, /*First error*/
V_pay_stat,
V_prod_nm,
V_ord_id,
V_war_nm,
V_ord_dt
);
END XXB_RJT_HEADER_PROCEURE;
当我编译这个时,我收到以下错误,
Error(37,7): PL/SQL: ORA-00984: column not allowed here
Error(24,65530): PL/SQL: SQL Statement ignored
感谢您的提前帮助
create or replace
PROCEDURE XXB_RJT_HEADER_PROCEURE
(
V_PROD_ID IN NUMBER,
V_WARE_ID IN XXB_RJT_HEADER.WAREHOUSE_ID% TYPE,
V_PAY_METH IN XXB_RJT_HEADER.PAYMENT_METHOD% TYPE,
V_PAY_STAT IN XXB_RJT_HEADER.PAYMENT_STATUS% TYPE,
V_ORD_ID IN XXB_RJT_HEADER.ORDER_ID% TYPE,
V_ORD_DT IN XXB_RJT_HEADER.ORDER_DATE% TYPE )
AS
V_PROD_NM VARCHAR2(50);
V_WAR_NM VARCHAR2(15);
BEGIN
SELECT PRODUCT_CAT
INTO V_PROD_NM
FROM xxb_rjt_inventory
WHERE XXB_RJT_INVENTORY.product_id= V_prod_id;
SELECT WAREHOUSE_NAME
INTO V_WAR_NM
FROM xxb_rjt_inventory
WHERE XXB_RJT_INVENTORY.product_id= V_prod_id;
INSERT
INTO XXB_RJT_HEADER
( /*second error*/
warehouse_id,
PAYMENT_METHOD,
payment_status,
product_name,
order_id,
wareshouse_name,
order_date
)
VALUES
(
V_warehouse_id,
v_pay_meth, /*First error*/
V_pay_stat,
V_prod_nm,
V_ord_id,
V_war_nm,
V_ord_dt
);
END XXB_RJT_HEADER_PROCEURE;
when i compile this i get the following errors
Error(37,7): PL/SQL: ORA-00984: column not allowed here
Error(24,65530): PL/SQL: SQL Statement ignored
thanks for the help in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以重写类似(未经测试)的内容:
这意味着要声明更少的两个 sql 语句和两个更少的变量。 还要更改过程的名称,您编写过程而不是过程。 我还更改了程序第一个参数的类型。
You can rewrite is in something like (untested):
This means two less sql statements and two less variables to declare. Also change the name of the procedure, you write proceure instead of procedure. I also changed the type of the first parameter of your procedure.
您的 ORA-00984 错误意味着:
检查 INSERT 的 VALUES 部分以确保没有任何参数是列。
解决该问题后,看看其他错误是否消失。 “PL/SQL: SQL 语句被忽略”似乎是在已经存在另一个错误之后出现的。
Your ORA-00984 error means:
Check the VALUES part of the INSERT to be sure none of the arguments are columns.
Once you fix that, see if the other error goes away. "PL/SQL: SQL Statement ignored" seems to appear after there's already another error.
“V_warehouse_id”没有在任何地方声明。
"V_warehouse_id" is no declared anywhere.