zend framework - Output size in procedure in oracle -
i have procedure:
create or replace procedure wypiszzamienniki (z_bloz12 in number ,output out varchar2) lv_test_cur sys_refcursor; begin if (z_bloz12 not null) cur_var in (select p.* produkt p join produkt p2 on p.nazwa_miedz = p2.nazwa_miedz , (p.dawka_l_p p2.dawka_l_p or p.dawka_l_p null , p2.dawka_l_p null) , (p.dawka_j_p = p2.dawka_j_p or p.dawka_j_p null , p2.dawka_j_p null) , (p.dawka_l_n = p2.dawka_l_n or p.dawka_l_n null , p2.dawka_l_n null) , (p.dawka_j_n = p2.dawka_j_n or p.dawka_j_n null , p2.dawka_j_n null) p.bloz12 != z_bloz12 , p2.bloz12 = z_bloz12) loop output := output ||cur_var.nazwa || ' ' || cur_var.opakowanie || ' ' || cur_var.podmiot_odp; dbms_output.put_line(cur_var.nazwa || ' ' || cur_var.opakowanie || ' ' || cur_var.podmiot_odp); end loop; end if; end wypiszzamienniki;
after executing
ora-06502: pl/sql: numeric or value error: character string buffer small ora-06512
problem output short. way or trick extend size of output? have tried set output value 'short' , works, if add there more characters throws exception.
this procedure invoked zend framework (php). code snippet controller class:
$db = zend_db_table_abstract::getdefaultadapter(); $sql = 'call wypiszzamienniki( :in_param1, :get_param1)'; $parameters = array(':in_param1' => 232440132296, ':get_param1' => ''); $returndata = null; $statement = $db->query($sql, $parameters); $statement->bindparam(':get_param1', $returndata, pdo::param_int, 2000); $result = $statement->execute(); zend_debug::dump($returndata); $this->view->zamienniki = $returndata;
as mentioned cant retrive such big values procedure have created function return cursor:
create or replace function wypiszzam (z_bloz12 in number) return sys_refcursor my_cursor sys_refcursor; begin if (z_bloz12 not null) open my_cursor select p.* produkt p join produkt p2 on p.nazwa_miedz = p2.nazwa_miedz , (p.dawka_l_p p2.dawka_l_p or p.dawka_l_p null , p2.dawka_l_p null) , (p.dawka_j_p = p2.dawka_j_p or p.dawka_j_p null , p2.dawka_j_p null) , (p.dawka_l_n = p2.dawka_l_n or p.dawka_l_n null , p2.dawka_l_n null) , (p.dawka_j_n = p2.dawka_j_n or p.dawka_j_n null , p2.dawka_j_n null) p.bloz12 != z_bloz12 , p2.bloz12 = z_bloz12; return my_cursor; end if; end wypiszzam;
i found code retrives cursor called procedure. problem cant find way cursor sql query. have this:
declare v_return sys_refcursor; begin v_return := wypiszzam(232440132296); end;
is there way test sql developer?
Comments
Post a Comment