2017-10-13 8 views
0

Oracle 데이터베이스 12c Enterprise Edition 릴리스 12.1.0.2.0 - 64bit Production DB에서이 절차를 수행 할 때마다이 오류가 발생합니다. 다시 컴파일하십시오. 절차는 사본이며, 다른 DB에서 붙여 때문에 오류가 다른 DB에서 패키지가 제대로 작동하기 때문에 ... 그럼에도 불구하고 나는이 오류가있어, 지금이 :오류 (3,34) : PLS-00201 : 식별자 XXX를 선언해야 함

Error(1,35): PLS-00304: cannot compile body of 'P_COUNTRY_PLATS' without its specification 

합니다.

create or replace PACKAGE "P_COUNTRY_PLATS" is 

procedure createNew (p_msisdn IN lopes.country_plats.recipient_msisdn%TYPE 
        ,p_channel IN lopes.country_plats.channel%TYPE 
        ,p_message IN lopes.country_plats.message%TYPE 
        ); 
procedure createNew (p_msisdn IN lopes.country_plats.recipient_msisdn%TYPE 
        ,p_channel IN lopes.country_plats.channel%TYPE 
        ,p_message IN lopes.country_plats.message%TYPE 
        ,p_request_date IN lopes.country_plats.request_date%TYPE 
        ,p_action_history_id IN lopes.country_plats.action_history_id%TYPE 
        ); 
procedure createNew (p_msisdn IN lopes.country_plats.recipient_msisdn%TYPE 
        ,p_channel IN lopes.country_plats.channel%TYPE 
        ,p_message IN lopes.country_plats.message%TYPE 
        ,p_request_date IN lopes.country_plats.request_date%TYPE 
        ,p_action_history_id IN lopes.country_plats.action_history_id%TYPE 
        ,p_ac_scheduled_action_id IN lopes.country_plats.ac_scheduled_action_id%TYPE 
        ); 

procedure getNextMsgToSend (p_channel IN lopes.country_plats.channel%TYPE 
          ,p_ip_address IN OUT VARCHAR2 
          ,p_message IN OUT lopes.country_plats.message%TYPE 
          ,p_msg_id IN OUT lopes.country_plats.country_plats_id%TYPE 
          ); 
procedure getNextMsgToSendByImei(p_imei IN VARCHAR2, p_message IN OUT VARCHAR2, p_msg_id IN OUT NUMBER); 

procedure setStatus(p_msg_id IN NUMBER, p_status IN VARCHAR2); 

procedure cancel_scheduled_actions; 
procedure cancel_scheduled_actions(p_msg_id IN number); 
end; 
/

create or replace PACKAGE BODY "P_COUNTRY_PLATS" is 
procedure createNew (p_msisdn IN lopes.country_plats.recipient_msisdn%TYPE 
        ,p_channel IN lopes.country_plats.channel%TYPE 
        ,p_message IN lopes.country_plats.message%TYPE 
        ) 
is 
begin 
    createNew(p_msisdn, p_channel, p_message, sysdate, null, null); 
end; 

procedure createNew (p_msisdn IN lopes.country_plats.recipient_msisdn%TYPE 
        ,p_channel IN lopes.country_plats.channel%TYPE 
        ,p_message IN lopes.country_plats.message%TYPE 
        ,p_request_date IN lopes.country_plats.request_date%TYPE 
        ,p_action_history_id IN lopes.country_plats.action_history_id%TYPE 
        ) 
is 
begin 
    createNew(p_msisdn, p_channel, p_message, p_request_date, p_action_history_id, null); 
end; 

procedure createNew (p_msisdn IN lopes.country_plats.recipient_msisdn%TYPE 
        ,p_channel IN lopes.country_plats.channel%TYPE 
        ,p_message IN lopes.country_plats.message%TYPE 
        ,p_request_date IN lopes.country_plats.request_date%TYPE 
        ,p_action_history_id IN lopes.country_plats.action_history_id%TYPE , 
        p_ac_scheduled_action_id IN lopes.country_plats.ac_scheduled_action_id%TYPE 
) 
is 
    PsdRetryNbroutgoing_psd number; 
begin 
    PsdRetryNbr := of_owner.p_ru.getPsdRetryNbr(p_msisdn); 

    of_owner.p_db_trc.trc(1007, '-'||p_channel||'-'||p_msisdn||'-'||p_message||'-'||p_request_date||'-'||p_action_history_id||'-'||p_ac_scheduled_action_id||'-'||PsdRetryNbr); 

    insert into lopes.country_plats 
    (country_plats_id,channel,recipient_msisdn,message,request_date,status,action_history_id, ac_scheduled_action_id, remaining_retry_nbr) values (
    lopes.SEQ_COUNTRY_PLATS_ID.nextval 
    ,p_channel 
    ,p_msisdn 
    ,p_message 
    , p_request_date 
    ,'R' 
    ,p_action_history_id 
    ,p_ac_scheduled_action_id 
    ,PsdRetryNbr 
); 
end;      

procedure getNextMsgToSend(p_channel IN lopes.country_plats.channel%TYPE 
          ,p_ip_address IN OUT VARCHAR2 
          ,p_message IN OUT lopes.country_plats.message%TYPE 
          ,p_msg_id IN OUT lopes.country_plats.country_plats_id%TYPE 
          ) 

is 
begin 
    select op.country_plats_id, op.message, of_owner.p_ru.getRemoteUnitCurrentIP(recipient_msisdn) 
    into p_msg_id, p_message, p_ip_address 
    from lopes.country_plats op 
    where ((op.status ='R') 
     or ((op.status = 'P') 
     and (op.outgoing_date+(of_owner.p_ru.getPsdRetryDelay(op.recipient_msisdn)/(60*24)) <= sysdate) 
     ) 
     ) 
    and rownum=1 
    order by request_date asc; 

    update lopes.country_plats 
    set outgoing_date = sysdate 
    , status = decode(remaining_retry_nbr, 0, 'F', 'P') 
    , remaining_retry_nbr = remaining_retry_nbr-1 
    where country_plats_id = p_msg_id; 

exception when no_data_found then 
    p_msg_id := -1; 
    p_ip_address:= ''; 
    p_message := ''; 
end; 

procedure getNextMsgToSendByImei(p_imei IN VARCHAR2, 
          p_message IN OUT VARCHAR2, 
          p_msg_id IN OUT NUMBER 
          ) is 
    p_vehicle_id number(10); 
    p_msisdn varchar2(50); 
begin 

    p_msg_id := -1; 
    p_message := ''; 

    select msisdn, vehicle_id 
    into p_msisdn, p_vehicle_id 
    from of_owner.remote_unit, of_owner.vehicle 
    where remote_unit.imei = p_imei 
    and remote_unit.remote_unit_id = vehicle.remote_unit_id(+); 

    begin 
    select op.country_plats_id, op.message 
    into p_msg_id, p_message 
    from lopes.country_plats op 
    where ((op.status ='R') 
     or ((op.status = 'P') 
      and (op.outgoing_date+(of_owner.p_ru.getPsdRetryDelay(op.recipient_msisdn)/(60*24)) <= sysdate) 
      ) 
     ) 
    and op.recipient_msisdn = p_msisdn 
    and rownum=1 
    order by request_date asc; 

    update lopes.country_plats 
    set outgoing_date = sysdate 
     , status = decode(remaining_retry_nbr, 0, 'F', 'P') 
     , remaining_retry_nbr = remaining_retry_nbr-1 
    where country_plats_id = p_msg_id; 
    exception when others then 
    null; 
    end; 
    -- Check if garmin message to send 
    if (p_msg_id=-1) and (p_vehicle_id is not null) then 
    p_msg_id := of_owner.p_gu_message.getNextMessageToSend(p_vehicle_id, p_message); 
    if (p_msg_id is null) then 
     p_msg_id:=-1; 
    end if; 
    end if; 

exception when no_data_found then 
    p_msg_id := -1; 
    p_message := ''; 
end; 

procedure setStatus(p_msg_id IN NUMBER, p_status IN VARCHAR2) 
is 
begin 

    update lopes.country_plats 
    set status = decode(p_status, 'S', 'S', decode(remaining_retry_nbr, 0, 'F', 'P')) 
    where country_plats_id = p_msg_id;  

end; 

procedure cancel_scheduled_actions is 
begin 
    delete from lopes.country_plats 
    where status = 'R' 
    and ac_scheduled_action_id is not null; 
end; 

procedure cancel_scheduled_actions(p_msg_id IN number) is 
begin 
    delete from lopes.country_plats 
    where country_plats_id = p_msg_id; 
end; 

end P_COUNTRY_PLATS; 
/
+0

'/ ''END;'명령문 다음에 새로운 줄에 문자를 넣어서 패키지 명세를 종료시킨다. 그런 다음 패키지 몸체의 끝에서'end PLATS; '로 변경하고 다음 줄 바꿈에'/'를 추가하십시오. – MT0

+1

HUH? 제목 : ** 오류 (3,34) : PLS-00201 : 식별자 XXX를 선언해야 함 ** 메시지 본문에서 : ** 오류 (1,35) : PLS-00304 : 'P_COUNTRY_PLATS'의 본문을 해당 스펙없이 컴파일 할 수 없음 **. 서로 다른 오류 코드 (201 vs 304), 다른 오류 메시지 - 분명히 두 오류는 서로 다른 성질을 가지며 코드의 다른 위치 (줄 3, 위치 34 대 줄 1, 위치 35)입니다. 그래서 : 그것은 무엇입니까? 그리고 어떻게 이런 일이 일어 났습니까? ("This"는 본문에 설명 된 바와 같이 한 가지 오류에 관한 메시지를 게시하고 완전히 다른 오류로 제목을 부여합니다.) – mathguy

+0

@en Lopes - PL-00201 또는 PLS-00304 중 어떤 것을 다루어야합니까? – g00dy

답변

1

/ 문자는 PL/SQL 블록에 대한 종결하고 스크립트가 그들을가 없습니다.

변경 :

end; 


create or replace PACKAGE BODY      "P_COUNTRY_PLATS" is 

사람 :

end; 
/

create or replace PACKAGE BODY      "P_COUNTRY_PLATS" is 

변경 마지막 :

end;PLATS 

에 : 넣어

end P_COUNTRY_PLATS; 
/
+0

이 사람의 제목과 메시지 본문의 내용이 일치하지 않음을 확인 했습니까? – mathguy