Welcome Guest, Not a member yet? Register   Sign In
query oracle 9i problem
#1

[eluser]sansanwawa[/eluser]
Hi!
im new in CI and i have a little bit problem within my oracle 9i query...

this is my model

Code:
class M_summary extends Model
{

    function __construct()
    {
        parent::Model();
    }
    
   function getVolRealization(&$ids)
   {
$query = $this->db->query("SELECT SUM(field1+field2) AS VOL FROM table WHERE field IN (".$ids.")");    
        $res = $query->result_array();
        print_r($res);
            
   }
  
  
    
   function getInfo()
   {
           $this->db->select('DISTINCT(field),field2');
        $this->db->from('table');
        $query = $this->db->get();
        
        if($query->num_rows())
        {
            $ready = $query->result_array();
            $query->free_result();
            return $ready;
        }
        else
        {
            return false;
        }
        
        
        
            
   }

  
}


and this is my controller

Code:
class Summary extends Controller
{
    function __construct()
    {
        parent::Controller();
        $this->load->model('m_summary');
        
    }
    
    
    function index(){
    
        $data["Show"] = $this->m_summary->getInfo();
                
        $this->load->view('summary/index',$data);
    
    }
}

when i used an object getVolRealization(),the query is still just like getInfo(),i'd was try to debug my output data (print_r) and the data is still like getInfo() method... Sad

im desperate with this ...Sad,is it an influence from persistent oracle 9i connection?

could any one help me how to figure it out....

warmest regards


Thanks
#2

[eluser]Unknown[/eluser]
Hi, I use Oracle 10g and I HAD the same problem. To solve it, you only have to do this :

Quote:Another update you may want to make is to the _set_stmp_id function in oci8_driver.php

Quote:
Code:
//if ( ! is_resource($this->stmt_id))
//{
   $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql));
//}

If I understand correctly, if you execute more than one query per client request, the same prepared statement will be use for each query.

Another note....the oci8 driver in CI doesn’t support true bind variables. I would hope that it would be available in the next release of CI. I currenly have to use ADODB instead of the $this->db object to make use of bind variables.

I think that Code Igniter is not compatible with Oracle 9,10 & 11g because there is a lot of errors...
Any way, CI Rocks!
#3

[eluser]sansanwawa[/eluser]
[quote author="memopages" date="1208038947"]Hi, I use Oracle 10g and I HAD the same problem. To solve it, you only have to do this :

Quote:Another update you may want to make is to the _set_stmp_id function in oci8_driver.php

Quote:
Code:
//if ( ! is_resource($this->stmt_id))
//{
   $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql));
//}

If I understand correctly, if you execute more than one query per client request, the same prepared statement will be use for each query.

Another note....the oci8 driver in CI doesn’t support true bind variables. I would hope that it would be available in the next release of CI. I currenly have to use ADODB instead of the $this->db object to make use of bind variables.

I think that Code Igniter is not compatible with Oracle 9,10 & 11g because there is a lot of errors...
Any way, CI Rocks![/quote]



Thx bro for your reply,

just info for CI and oracle,if u want to delete or update records use..
Code:
$this->db->simple_query($sql)

that simple_query method has OCI_COMMIT_ON_SUCCESS after each query.

Hand to hand.



thanks



Sandy




Theme © iAndrew 2016 - Forum software by © MyBB