background image
<< Verify Playback Return Codes | Playback Pacing >>
<< Verify Playback Return Codes | Playback Pacing >>
SQL statement
Setting Script Generation Options
6-15
Example of the Verify Playback Check Boxes
Suppose you want the script to execute the following SQL statement:
INSERT INTO mytable VALUES ("value1", "value2")
Depending on your
Verify playback row counts
Verify playback row counts
Verify playback row counts
Verify playback row counts
and
Verify playback return codes
Verify playback return codes
Verify playback return codes
Verify playback return codes
selections, Robot generates the SQL statement in one of the following ways:
Because one SQL statement can return multiple error messages (for example, as a
result of stored procedure execution),
EXPECT_ERROR
is an array. During
playback, if an error code is returned that is not one of the values specified in the
array, TestManager generates an error.
Check box
selected
VU command and meaning
Neither
sqlexec ["x001"] "INSERT INTO mytable VALUES
('value1', 'value2')";
During recording, Robot does not report the data it collects from the
execution of the SQL statement. During playback, TestManager
assumes that any non-zero return code is an error. It pays no attention
to the number of affected rows.
Verify playback
return codes
sqlexec ["x001"] EXPECT_ERROR {-212}, "INSERT
INTO mytable VALUES ('value1', 'value2')";
Robot records that the error code -212 was returned from the SQL
statement. During playback, TestManager expects the SQL statement
to return the error code -212. If the SQL statement returns a different
code during playback, the Test Log window notes the discrepancy.
Verify playback
row counts
sqlexec ["x001"] EXPECT_ROWS 1, "INSERT INTO
mytable VALUES ('value1', 'value2')";
Robot records that one row was affected by the SQL statement.
During playback, TestManager expects the SQL statement to affect
one row. If the SQL statement returns a different count during
playback, the Test Log window notes the discrepancy.
Both
sqlexec ["x001"] EXPECT_ERROR {-212},
EXPECT_ROWS 0, "INSERT INTO mytable VALUES
('value1', 'value2');
Robot records that the SQL statement returned the error code -212,
and that no rows were affected. During playback, TestManager
expects that the SQL statement will return error -212 and that no
rows will be affected. If the SQL statement returns different results
during playback, the Test Log window notes the discrepancy.