Quiero ejecutar un procedimiento sql, el procedimineto me regresa una serie de filas pero al ejecuarlo manda el siguiente error:
Warning: Uncaught PDOException: SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Sintaxis incorrecta cerca de '@P1'.
PDOStatement->execute() #1
Fatal error: Illegal or unknown output parameter type. This should have been caught in core_sqlsrv_bind_parameter.
La consulta la estoy haciendo de la siguiente forma:
Código PHP:
$query = $this->db->prepare('CALL '.$name_sp.'(?,?,?,?,?)');
$param = 'undefined';
$param2 = 0;
$sentencia = 'select';
$query->bindParam(1,$param,PDO::PARAM_STR,20);
$query->bindParam(2,$param,PDO::PARAM_STR,20);
$query->bindParam(3,$param2,PDO::PARAM_INT,5);
$query->bindParam(4,$param,PDO::PARAM_STR,20);
$query->bindParam(5,$sentencia,PDO::PARAM_STR,20);
$query->execute();