SQL错误,警告:使用编译错误创建的过程

时间:2018-03-31 00:45:19

标签: oracle plsql

create or replace procedure pro_update_last_read
(sensorID in sensor.sensor_id%type
, read_date in sensor.last_charged%type)
begin
    update sensor
    set last_charged = read_date 
    where sensor_id = sensorID;
end;
/
  

警告:使用编译错误创建过程。

它有什么问题?

3 个答案:

答案 0 :(得分:0)

在开始之前添加关键字AS,然后重试。如果这没有帮助,请在此处写下您的参数类型。并标记您的数据库(rdbms)名称。

答案 1 :(得分:0)

缺少AS(或IS);除此之外,应该没问题:

SQL> create table sensor
  2    (sensor_id number,
  3     read_date date,
  4     last_charged date);

Table created.

SQL>
SQL> create or replace procedure pro_update_last_read
  2  (sensorID in sensor.sensor_id%type
  3  , read_date in sensor.last_charged%type) as        --> here
  4  begin
  5      update sensor
  6      set last_charged = read_date
  7      where sensor_id = sensorID;
  8  end;
  9  /

Procedure created.

SQL>

答案 2 :(得分:0)

你错过了'AS'这个词

switch1