1

I need you help on how to call the stored procedure that I made in MsSQL, it is a upload function.

here is my current code in CI:

Model

function search($data){

    $qString="[gen048upload]";


    $this->db->query('set ansi_padding on
                        set ARITHABORT on
                        set CONCAT_NULL_YIELDS_NULL on
                        set QUOTED_IDENTIFIER on
                        set ANSI_NULLS on
                        set ANSI_WARNINGS on
                        set numeric_roundabort off');
    $query = $this->db->query($qString);    
    return ($query->num_rows() > 0) ? $query->result() : NULL;
}

my current controller is just for copying to other directory but here it is:

Controller

    function upgen048()
{

    $this->file_path = realpath(navi_ups.'/gen048');

    $config['upload_path'] = $this->file_path;
    $config['max_size'] = 0;
    $config['allowed_types'] = 'txt';
    $config['overwrite'] = TRUE;

    $this->load->library('upload');
    $this->upload->initialize($config);
    $this->upload->set_allowed_types('*');

    if ( !$this->upload->do_upload('uploadData'))
        {   
                $data['error'] = $this->upload->display_errors();
                $data['main_content'] = 'upgen048';
                $this->load->view('includes/template',$data);
        }
    else { //else, set the success message
                $data = array('msg' => "Upload success!");
                $data['main_content'] = 'upgen048';
                $this->load->view('includes/template',$data);
                $data['upload_data'] = $this->upload->data();

    }
Vince Osana
  • 416
  • 1
  • 5
  • 22
  • `$this->db->query("call {storedprocedure function name} ");` – Abdulla Nilam Jan 12 '16 at 05:41
  • 2
    Possible duplicate of [Calling a stored procedure from CodeIgniter's Active Record class](http://stackoverflow.com/questions/4827752/calling-a-stored-procedure-from-codeigniters-active-record-class) – Abdulla Nilam Jan 12 '16 at 05:43

0 Answers0