Override rows number affected returned by stored procedure that uses cursor inside
Tag : .net , By : agjimenez
Date : March 29 2020, 07:55 AM
will be helpful for those in need First, don't mess with SET ROWCOUNT - that does something very dangerous (if used incorrectly). Return values are actually handled by adding a parameter with "direction" of ReturnValue. Alternatively, SELECT the value, and use ExecuteScalar.
|
How to get the affected rows in stored procedure
Date : March 29 2020, 07:55 AM
Hope this helps It seems you can use the following in a stored procedure to extract the rowcount. if dbinfo('sqlca.sqlerrd2') = 0 then
return 0;
else
return 1;
end if;
|
Stored procedure in while affected only first row
Date : March 29 2020, 07:55 AM
To fix this issue You are overwriting your $stmt variable. Change the name of the variable you use in the while loop: while ($row = sqlsrv_fetch_array($stmt)) {
// print works fine without call proc
$query = "{call difInport(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
$params = array("0gtp", $row["Kostenstelle"], $row["Vorname"], $row["Nachname"], $row["CI-Nummer"], $row["cmo_mon"], $row["Raum"], $row["Gebaeude"], $row["Bemerkung"], $row["Hardware"], $row["fmo_mon"], $row["Zubehoer"]);
$stmt_proc = sqlsrv_query($conn, $query, $params);
if ($stmt_proc === false) {
die (print_r(sqlsrv_errors(), true));
}
}
|
How to manipulate resultset returned by a stored procedure called inside the stored procedure in DB2
Date : March 29 2020, 07:55 AM
like below fixes the issue This is covered in the documentation. The key details to learn about are locators, associate result set locators and then allocate ... cursor for result set. After that is done, your calling procedure can treat the cursor just like any other (fetching rows , close etc).
|
How to insert result set returned by an oracle stored procedure into another table using second stored procedure?
Tag : oracle , By : Blaise Roth
Date : March 29 2020, 07:55 AM
|