db2_execute() executes an SQL statement that was
prepared by db2_prepare().
If the SQL statement returns a result set, for example, a SELECT statement
or a CALL to a stored procedure that returns one or more result sets, you
can retrieve a row as an array from the stmt resource
using db2_fetch_assoc(),
db2_fetch_both(), or
db2_fetch_array(). Alternatively, you can use
db2_fetch_row() to move the result set pointer to the
next row and fetch a column at a time from that row with
db2_result().
An array of input parameters matching any parameter markers contained
in the prepared statement.
Valores retornados
Devuelve TRUE si todo se
llevó a cabo correctamente, FALSE en caso
de fallo.
Ejemplos
Ejemplo 1. Preparing and executing an SQL statement with parameter markers
The following example prepares an INSERT statement that accepts four
parameter markers, then iterates over an array of arrays containing the
input values to be passed to db2_execute().
$stmt = db2_prepare($conn, $insert); if ($stmt) { $result = db2_execute($stmt, $pet); if ($result) { print "Successfully added new pet."; } } ?>
El resultado del ejemplo seria:
Successfully added new pet.
Ejemplo 2. Calling a stored procedure with an OUT parameter
The following example prepares a CALL statement that accepts one
parameter marker representing an OUT parameter, binds the PHP variable
$my_pets to the parameter using
db2_bind_param(), then issues
db2_execute() to execute the CALL statement. After the
CALL to the stored procedure has been made, the value of
$num_pets changes to reflect the value returned by the
stored procedure for that OUT parameter.
Atención técnica y comercial: (54)-11-5031-1111 las 24 hs. los 365 días del año. ToWebs, (c) 2008
Virtucom Networks S.A Av. Belgrano 1586, piso 10 (C1093AAQ) Cap. Fed. Bs. As, Argentina.