PL/SQL Oracle 在编写带有子查询的插入语句时出错



这是我INSERT声明:

INSERT INTO customer_payment (payment_type_id, PAYMENT_METHOD, PAYMENT_STATUS, sql_sequence)
((SELECT emcpm.payment_method_type_id,
         epmt.description, ecba.mandate_status 
  FROM cust_pay_map emcpm, payment_method_type epmt, customer_bank_account ecba 
  WHERE emcpm.payment_method_type_id = ecba.payment_method_type_id), MY_SEQ.nextval);

我收到错误

ORA-00907:缺少右括号

当我运行它时。请帮我纠正错误。

在 select 语句中添加序列,如下所示:

    INSERT
INTO customer_payment
  (
    payment_type_id,
    PAYMENT_METHOD,
    PAYMENT_STATUS,
    sql_sequence
  )
SELECT emcpm.payment_method_type_id,
  epmt.description,
  ecba.mandate_status ,
  MY_SEQ.nextval
FROM cust_pay_map emcpm,
  payment_method_type epmt,
  customer_bank_account ecba
WHERE emcpm.payment_method_type_id = ecba.payment_method_type_id;

相关内容

  • 没有找到相关文章

最新更新