• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass tablename,fields,values to Stored Procedure dynamically

#1
I am developing a custom application using CodeIgniter and MSSQL Server. Here i am using stored procedures.
Now i am wondering to implement codeigniter query type functionality where i can create a universal stored procedure in SQL Server and at the time of using i can pass tablename, array of fields and values.
It can work for both insert and update.



Something like we do in CodeIgniter to execute the query,

```

Code:
$data = array('fieldname1' => 'value1',
'fieldname2' => 'value2');

$this->db->insert($tablename,$data);

```

Just like this if we can pass the table name and array of the data to stored procedure and stored procedure automatically execute it.

If this can be done, it can save lots n lots of man hours. If anyone have already done i will be very much happy to see the solution.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.