こことWebで解決策を検索しましたが、経験の浅い他のエラーが発生しているようです(最初のビルドはPHPでしたが、今はストアドプロシージャに移動する必要があります)。私が持っているのは私のキャンパスの地図です。ユーザーが建物をクリックすると、情報バブルが開き、いくつかの情報と写真のギャラリーが表示されます。写真のアドレスはテーブルに格納されているため、それらをループできるように配列に戻す必要があります。リストを取得する呼び出しは次のとおりです。
$.ajax({ //get the picture URLs, load into array
type: "post",
url: "video_tour.get_pics",
data: { pBldg_id: building
},
error: function(xhr,thrownError) { alert("error get pics"); },
success: function(data){
$.each(data, function(index,obj) {
picArray[index] = obj.ADDRESS;
});
}
});//and ajax for pic load
および呼び出されたプロシージャ:
procedure get_pics(pBldg_id int) is
type array_varchar is table of varchar2(2000) index by binary_integer;
array_of_pics array_varchar;
v_counter int := 0;
begin
for i in(select address from ucs.campus_pictures where building_id = pBldg_id and thumbnail = 1) loop
array_of_pics(v_counter) := i.address;
v_counter := v_counter + 1;
end loop;
end get_pics;
array_of_pics を ajax 呼び出しに戻すにはどうすればよいですか?