2017-04-21 14 views
0

私はこの警告をヒキガキにしています。したがって、この手順を使用することはできません。私はまずVARRAYを作成しています。警告:コンパイルされましたが、oracleでコンパイルエラーが発生しました

CREATE or replace TYPE notif_array AS VARRAY(100000) OF VARCHAR2(10); 

次に、プロシージャを作成しています。

CREATE OR REPLACE PROCEDURE get_notification_id 
    (personrole in varchar2, personid out notif_array) 
is 
begin 
    DBMS_OUTPUT.PUT_LINE(personrole); 

    select person_id into personid 
    from exp_role_person_mapping 
    where person_role = personrole; 
exception 
    when others then 
     personid := null; 
end; 

は、その後に私はあなたがPERSONIDするデータを割り当てする方法を、変更する必要がヒキガエル

Warning: compiled but with compilation errors 
+0

実際の問題を見るには、 'user errors'ビューを照会してください。 (Toadが 'show errors'をサポートしているかどうかはわかりません。) –

+0

@AlexPoole。試しました。 「エラーなし」と表示されます。 –

+0

プロシージャにカーソルを移動し、F4キーを押すと、ポップアップ・ウィンドウが開き、「エラー」タブに移動します。 – user75ponic

答えて

0

から警告を取得しています。

CREATE OR REPLACE PROCEDURE get_notification_id(personrole in varchar2,personid out notif_array) 
is 
CURSOR cur_temp(per_role varchar2) 
IS 
    select person_id from exp_role_person_mapping where person_role=per_role; 
    index NUMBER := 1; 
begin 
    DBMS_OUTPUT.PUT_LINE(personrole); 
    FOR datarecord in cur_temp(personrole) 
    LOOP 
     personid(index) := datarecord.person_id; 
     index = index + 1; 
    END LOOP; 
exception when others then 
    personid:=null; 
end; 
0

あなたの要件ごとに定義されたそのカスタムデータ型がちょうどselect文で「一括収集」を追加むしろそれは、基本データ型ではありません。 Ponder Stibbonsに感謝します

CREATE OR REPLACE PROCEDURE get_notification_id(personrole in varchar2,personid out notif_array) 
is 
begin 
select person_id bulk collect into personid from exp_role_person_mapping where person_role=personrole; 
exception when others then 
personid:=null; 
end; 
関連する問題