Skip to content

Commit cbcc729

Browse files
committed
more compatible SQL, error messages
1 parent 29ca273 commit cbcc729

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_gh_62.phpt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@ $table = "EMPTY_NVARCHAR";
1313
$drop = "DROP TABLE $table";
1414
$res = @db2_exec($conn, $drop);
1515
/* ensure that SQL_NTS is used so empty strings work for not just VARCHAR */
16-
$create = "CREATE OR REPLACE TABLE $table (TEXTME NVARCHAR(1024))"; /* CCSID 1200? */
16+
$create = "CREATE TABLE $table (TEXTME NVARCHAR(1024))"; /* CCSID 1200? */
1717
$res = db2_exec($conn, $create);
18+
if ($res == false) {
19+
die("Failed to create table: " . db2_stmt_error($create) . " - " . db2_stmt_errormsg($create) . "\n");
20+
}
1821
$insert = "INSERT INTO $table (TEXTME) VALUES (?)";
1922
$sth = db2_prepare($conn, $insert);
2023
$res = db2_execute($sth, array($input));
24+
if ($res == false) {
25+
die("Failed to insert: " . db2_stmt_error($insert) . " - " . db2_stmt_errormsg($insert) . "\n");
26+
}
2127
$look = "select TEXTME from $table";
2228
$res = db2_exec($conn, $look);
2329
$row = db2_fetch_array($res);

0 commit comments

Comments
 (0)