Oracle PLSQL:在过程中为列的所有行分配一个值(数字)
我有一张桌子,是这样的:Oracle PLSQL:在过程中为列的所有行分配一个值(数字),oracle,plsql,Oracle,Plsql,我有一张桌子,是这样的: Invc_Ref | OrderID (null) | 123 (null) | 124 (null) | 125 (null) | 126 我想用一个特定的值完全填充Invc_Ref列。说456789 Invc_Ref | OrderID 456789 | 123 456789 | 124 456789 | 125 456789 | 126 我桌上有将近20万 只是: update your_table set invc_ref =
Invc_Ref | OrderID
(null) | 123
(null) | 124
(null) | 125
(null) | 126
我想用一个特定的值完全填充Invc_Ref列。说456789
Invc_Ref | OrderID
456789 | 123
456789 | 124
456789 | 125
456789 | 126
我桌上有将近20万 只是:
update your_table set invc_ref = 456789;
您可以创建这样一个简单的过程
SQL> create or replace procedure pr_invoices( i_invc_ref t_invoices.invc_ref%type ) is
begin
update t_invoices
set invc_ref = i_invc_ref;
end;
/
SQL> exec pr_invoices(456789);
并在需要时更改上述标量值
警告:确保之前没有名为
pr\u invoices
的程序,因为创建该程序时使用了replace
选项。更新表集invc\u ref=456789
?@Rene,因为OP在标题中的程序中告诉。