Create a pivot table

Hi Fab,

Database object available from Suite CRM doesn’t work with stored procedures at all.

If you are creating a custom report, then you can do that by using the following code:

global $sugar_config;
$conn = new mysqli(
$sugar_config[‘dbconfig’][‘db_host_name’],
$sugar_config[‘dbconfig’][‘db_user_name’],
$sugar_config[‘dbconfig’][‘db_password’],
$sugar_config[‘dbconfig’][‘db_name’]);

$sql = “CALL my_stored_proc(…);”;
$res = $conn->query($sql);
…
$conn->close();

Reference Link: Calling stored procedures from logic hooks - #3 by chogori