php - error getting data procedure in codeigniter -


i created stored procedure, saves values ​​in table temporal.y show "select " in sqlserver works . when call procedure in codeigniter generated empty array.

this procedure in codeigniter

function verificacion_ocupados($codigo,$llave_maestra){     $sql = "sp_verificacionocupados ?, ?";     $query = $this->db->query($sql,array($codigo, $llave_maestra));      $data = $query->result();     $query->free_result();                 return $data;  } 

this procedure

create procedure [dbo].[sp_verificacionocupados] @codigo int, @llave_maestro varchar(50)       declare @finicio date;    declare @ffinal date;    declare @codigo_dias int;    declare @no varchar(100);    create table #pivote(     code int     );     set @no='veremos';    begin        select @ffinal=oel_fecha_fin,@finicio=oel_fecha_inicio         operaciones_especiales_llave        em_codigo=@codigo , oel_estado=2 , th_llave=@llave_maestro ;           if @@rowcount>0            begin                            insert #pivote values (2);                  end     end      select code #pivote; go 

this 1 example of larger consultation doing . think problem in temporary table , call return data.

who has idea problem ? . in advance

change following.

   function verificacion_ocupados($codigo,$llave_maestra)   {     $sql="sp_verificacionocupadose ?, ?";     $query=$this->db->query('call sp_verificacionocupadose("$codigo","$llave_maestra")'));      $data=$query->result();     $query->free_result();                return $data;   } 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -