@@ -73,15 +73,15 @@ describe('116. fetchUrowidAsString.js', function() {
73
73
} ) ;
74
74
75
75
const insertData = async function ( connection , tableName ) {
76
- for ( const element in dataArray ) {
77
- const sql = "INSERT INTO " + tableName + "(num) VALUES(" + element + ")" ;
76
+ for ( let index = 0 ; index < dataArray . length ; index ++ ) {
77
+ const sql = "INSERT INTO " + tableName + "(num) VALUES(" + index + ")" ;
78
78
await connection . execute ( sql ) ;
79
79
}
80
80
} ;
81
81
82
82
const updateData = async function ( connection , tableName ) {
83
- for ( const element in dataArray ) {
84
- const sql = "UPDATE " + tableName + " T SET content = T.ROWID where num = " + element ;
83
+ for ( let index = 0 ; index < dataArray . length ; index ++ ) {
84
+ const sql = "UPDATE " + tableName + " T SET content = T.ROWID where num = " + index ;
85
85
await connection . execute ( sql ) ;
86
86
}
87
87
} ;
@@ -442,8 +442,8 @@ describe('116. fetchUrowidAsString.js', function() {
442
442
} ) ;
443
443
444
444
async function test1 ( option , object ) {
445
- for ( const element in dataArray ) {
446
- const sql = "select content,rowid from " + tableName + " where num = " + element ;
445
+ for ( let index = 0 ; index < dataArray . length ; index ++ ) {
446
+ const sql = "select content,rowid from " + tableName + " where num = " + index ;
447
447
const result = await connection . execute ( sql , [ ] , option ) ;
448
448
let resultVal_1 = result . rows [ 0 ] [ 0 ] ;
449
449
let resultVal_2 = result . rows [ 0 ] [ 1 ] ;
@@ -458,8 +458,8 @@ describe('116. fetchUrowidAsString.js', function() {
458
458
}
459
459
460
460
async function test2 ( option , object ) {
461
- for ( const element in dataArray ) {
462
- const sql = "select content,rowid from " + tableName + " where num = " + element ;
461
+ for ( let index = 0 ; index < dataArray . length ; index ++ ) {
462
+ const sql = "select content,rowid from " + tableName + " where num = " + index ;
463
463
const result = await connection . execute ( sql , [ ] , option ) ;
464
464
const row = await result . resultSet . getRow ( ) ;
465
465
let resultVal_1 = row [ 0 ] ;
0 commit comments