I’ve searched here and the web for a solution, but they just seem to cause other errors I’m too inexperienced with (the first build was in PHP, now I have to move it to a stored procedure). What I have is a map of my campus, and when a user clicks on a building, an info bubble pops open to show some information and a gallery of pictures. The address of the picture are stored in a table, so I need them to come back in an array so I can loop through them. The call to get the list is:
$.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
and the called procedure:
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;
How can I can I take the array_of_pics back to the ajax call?
So it wasn’t as complex as it seemed, I just need to print the data as it comes out and add a delimiting character:
and make an array in the ajax call:
Thanks guys for taking the time to help!