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";
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 );
You can’t perform that action at this time.
0 commit comments