File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ $table = "EMPTY_NVARCHAR";
13
13
$ drop = "DROP TABLE $ table " ;
14
14
$ res = @db2_exec ($ conn , $ drop );
15
15
/* 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? */
17
17
$ 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
+ }
18
21
$ insert = "INSERT INTO $ table (TEXTME) VALUES (?) " ;
19
22
$ sth = db2_prepare ($ conn , $ insert );
20
23
$ 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
+ }
21
27
$ look = "select TEXTME from $ table " ;
22
28
$ res = db2_exec ($ conn , $ look );
23
29
$ row = db2_fetch_array ($ res );
You can’t perform that action at this time.
0 commit comments