1e41f4b71Sopenharmony_ci# resultSet 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciA result set is a set of results returned after the relational database (RDB) query APIs are called. You can use the **resultset** APIs to obtain required data. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> - The APIs of this module are no longer maintained since API version 9. You are advised to use [@ohos.data.relationalStore#ResultSet](js-apis-data-relationalStore.md#resultset). 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci## ResultSet 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciProvides methods to access the result set, which is obtained by querying the RDB store. 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci### Usage 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciYou need to obtain a **resultSet** object by using [RdbStore.query()](js-apis-data-rdb.md#query). 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci```js 20e41f4b71Sopenharmony_ciimport dataRdb from '@ohos.data.rdb'; 21e41f4b71Sopenharmony_cilet predicates = new dataRdb.RdbPredicates("EMPLOYEE"); 22e41f4b71Sopenharmony_cipredicates.equalTo("AGE", 18); 23e41f4b71Sopenharmony_cilet promise = rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 24e41f4b71Sopenharmony_cipromise.then((resultSet) => { 25e41f4b71Sopenharmony_ci console.log(TAG + "resultSet columnNames:" + resultSet.columnNames); 26e41f4b71Sopenharmony_ci console.log(TAG + "resultSet columnCount:" + resultSet.columnCount); 27e41f4b71Sopenharmony_ci}); 28e41f4b71Sopenharmony_ci``` 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci### Properties 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 35e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 36e41f4b71Sopenharmony_ci| columnNames | Array<string> | Yes| Names of all columns in the result set.| 37e41f4b71Sopenharmony_ci| columnCount | number | Yes| Number of columns in the result set.| 38e41f4b71Sopenharmony_ci| rowCount | number | Yes| Number of rows in the result set.| 39e41f4b71Sopenharmony_ci| rowIndex | number | Yes| Index of the current row in the result set.| 40e41f4b71Sopenharmony_ci| isAtFirstRow | boolean | Yes| Whether the cursor is in the first row of the result set.| 41e41f4b71Sopenharmony_ci| isAtLastRow | boolean | Yes| Whether the cursor is in the last row of the result set.| 42e41f4b71Sopenharmony_ci| isEnded | boolean | Yes| Whether the cursor is after the last row of the result set.| 43e41f4b71Sopenharmony_ci| isStarted | boolean | Yes| Whether the cursor has been moved.| 44e41f4b71Sopenharmony_ci| isClosed | boolean | Yes| Whether the result set is closed.| 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci### getColumnIndex 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_cigetColumnIndex(columnName: string): number 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ciObtains the column index based on the column name. 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci**Parameters** 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 57e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 58e41f4b71Sopenharmony_ci| columnName | string | Yes| Column name specified.| 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci**Return value** 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci| Type| Description| 63e41f4b71Sopenharmony_ci| -------- | -------- | 64e41f4b71Sopenharmony_ci| number | Index of the column obtained.| 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci**Example** 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci ```js 69e41f4b71Sopenharmony_ci resultSet.goToFirstRow(); 70e41f4b71Sopenharmony_ci const id = resultSet.getLong(resultSet.getColumnIndex("ID")); 71e41f4b71Sopenharmony_ci const name = resultSet.getString(resultSet.getColumnIndex("NAME")); 72e41f4b71Sopenharmony_ci const age = resultSet.getLong(resultSet.getColumnIndex("AGE")); 73e41f4b71Sopenharmony_ci const salary = resultSet.getDouble(resultSet.getColumnIndex("SALARY")); 74e41f4b71Sopenharmony_ci ``` 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci### getColumnName 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_cigetColumnName(columnIndex: number): string 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ciObtains the column name based on the column index. 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci**Parameters** 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 87e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 88e41f4b71Sopenharmony_ci| columnIndex | number | Yes| Column index specified.| 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci**Return value** 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci| Type| Description| 93e41f4b71Sopenharmony_ci| -------- | -------- | 94e41f4b71Sopenharmony_ci| string | Column name obtained.| 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ci**Example** 97e41f4b71Sopenharmony_ci 98e41f4b71Sopenharmony_ci ```js 99e41f4b71Sopenharmony_ci const id = resultSet.getColumnName(0); 100e41f4b71Sopenharmony_ci const name = resultSet.getColumnName(1); 101e41f4b71Sopenharmony_ci const age = resultSet.getColumnName(2); 102e41f4b71Sopenharmony_ci ``` 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_ci### goTo 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_cigoTo(offset:number): boolean 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ciMoves the cursor to the row based on the specified offset. 109e41f4b71Sopenharmony_ci 110e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ci**Parameters** 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 115e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 116e41f4b71Sopenharmony_ci| offset | number | Yes| Offset relative to the current position.| 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci**Return value** 119e41f4b71Sopenharmony_ci 120e41f4b71Sopenharmony_ci| Type| Description| 121e41f4b71Sopenharmony_ci| -------- | -------- | 122e41f4b71Sopenharmony_ci| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci**Example** 125e41f4b71Sopenharmony_ci 126e41f4b71Sopenharmony_ci ```js 127e41f4b71Sopenharmony_ci let predicatesgoto = new dataRdb.RdbPredicates("EMPLOYEE"); 128e41f4b71Sopenharmony_ci let promisequerygoto = rdbStore.query(predicatesgoto, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 129e41f4b71Sopenharmony_ci promisequerygoto.then((resultSet) => { 130e41f4b71Sopenharmony_ci resultSet.goTo(1); 131e41f4b71Sopenharmony_ci resultSet.close(); 132e41f4b71Sopenharmony_ci }).catch((err) => { 133e41f4b71Sopenharmony_ci console.log('query failed'); 134e41f4b71Sopenharmony_ci }); 135e41f4b71Sopenharmony_ci ``` 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci### goToRow 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_cigoToRow(position: number): boolean 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ciMoves the cursor to the specified row in the result set. 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 144e41f4b71Sopenharmony_ci 145e41f4b71Sopenharmony_ci**Parameters** 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 148e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 149e41f4b71Sopenharmony_ci| position | number | Yes| Position to which the cursor is to be moved.| 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ci**Return value** 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci| Type| Description| 154e41f4b71Sopenharmony_ci| -------- | -------- | 155e41f4b71Sopenharmony_ci| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci**Example** 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci ```js 160e41f4b71Sopenharmony_ci let predicatesgotorow = new dataRdb.RdbPredicates("EMPLOYEE"); 161e41f4b71Sopenharmony_ci let promisequerygotorow = rdbStore.query(predicatesgotorow, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 162e41f4b71Sopenharmony_ci promisequerygotorow.then((resultSet) => { 163e41f4b71Sopenharmony_ci resultSet.goToRow(5); 164e41f4b71Sopenharmony_ci resultSet.close(); 165e41f4b71Sopenharmony_ci }).catch((err) => { 166e41f4b71Sopenharmony_ci console.log('query failed'); 167e41f4b71Sopenharmony_ci }); 168e41f4b71Sopenharmony_ci ``` 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci### goToFirstRow 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_cigoToFirstRow(): boolean 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ciMoves the cursor to the first row of the result set. 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci**Return value** 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci| Type| Description| 181e41f4b71Sopenharmony_ci| -------- | -------- | 182e41f4b71Sopenharmony_ci| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| 183e41f4b71Sopenharmony_ci 184e41f4b71Sopenharmony_ci**Example** 185e41f4b71Sopenharmony_ci 186e41f4b71Sopenharmony_ci ```js 187e41f4b71Sopenharmony_ci let predicatesgoFirst = new dataRdb.RdbPredicates("EMPLOYEE"); 188e41f4b71Sopenharmony_ci let promisequerygoFirst = rdbStore.query(predicatesgoFirst, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 189e41f4b71Sopenharmony_ci promisequerygoFirst.then((resultSet) => { 190e41f4b71Sopenharmony_ci resultSet.goToFirstRow(); 191e41f4b71Sopenharmony_ci resultSet.close(); 192e41f4b71Sopenharmony_ci }).catch((err) => { 193e41f4b71Sopenharmony_ci console.log('query failed'); 194e41f4b71Sopenharmony_ci }); 195e41f4b71Sopenharmony_ci ``` 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci### goToLastRow 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_cigoToLastRow(): boolean 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ciMoves the cursor to the last row of the result set. 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ci**Return value** 206e41f4b71Sopenharmony_ci 207e41f4b71Sopenharmony_ci| Type| Description| 208e41f4b71Sopenharmony_ci| -------- | -------- | 209e41f4b71Sopenharmony_ci| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| 210e41f4b71Sopenharmony_ci 211e41f4b71Sopenharmony_ci**Example** 212e41f4b71Sopenharmony_ci 213e41f4b71Sopenharmony_ci ```js 214e41f4b71Sopenharmony_ci let predicatesgoLast = new dataRdb.RdbPredicates("EMPLOYEE"); 215e41f4b71Sopenharmony_ci let promisequerygoLast = rdbStore.query(predicatesgoLast, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 216e41f4b71Sopenharmony_ci promisequerygoLast.then((resultSet) => { 217e41f4b71Sopenharmony_ci resultSet.goToLastRow(); 218e41f4b71Sopenharmony_ci resultSet.close(); 219e41f4b71Sopenharmony_ci }).catch((err) => { 220e41f4b71Sopenharmony_ci console.log('query failed'); 221e41f4b71Sopenharmony_ci }); 222e41f4b71Sopenharmony_ci ``` 223e41f4b71Sopenharmony_ci 224e41f4b71Sopenharmony_ci### goToNextRow 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_cigoToNextRow(): boolean 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ciMoves the cursor to the next row in the result set. 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ci**Return value** 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci| Type| Description| 235e41f4b71Sopenharmony_ci| -------- | -------- | 236e41f4b71Sopenharmony_ci| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ci**Example** 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ci ```js 241e41f4b71Sopenharmony_ci let predicatesgoNext = new dataRdb.RdbPredicates("EMPLOYEE"); 242e41f4b71Sopenharmony_ci let promisequerygoNext = rdbStore.query(predicatesgoNext, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 243e41f4b71Sopenharmony_ci promisequerygoNext.then((resultSet) => { 244e41f4b71Sopenharmony_ci resultSet.goToNextRow(); 245e41f4b71Sopenharmony_ci resultSet.close(); 246e41f4b71Sopenharmony_ci }).catch((err) => { 247e41f4b71Sopenharmony_ci console.log('query failed'); 248e41f4b71Sopenharmony_ci }); 249e41f4b71Sopenharmony_ci ``` 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci### goToPreviousRow 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_cigoToPreviousRow(): boolean 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_ciMoves the cursor to the previous row in the result set. 256e41f4b71Sopenharmony_ci 257e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 258e41f4b71Sopenharmony_ci 259e41f4b71Sopenharmony_ci**Return value** 260e41f4b71Sopenharmony_ci 261e41f4b71Sopenharmony_ci| Type| Description| 262e41f4b71Sopenharmony_ci| -------- | -------- | 263e41f4b71Sopenharmony_ci| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| 264e41f4b71Sopenharmony_ci 265e41f4b71Sopenharmony_ci**Example** 266e41f4b71Sopenharmony_ci 267e41f4b71Sopenharmony_ci ```js 268e41f4b71Sopenharmony_ci let predicatesgoPrev = new dataRdb.RdbPredicates("EMPLOYEE"); 269e41f4b71Sopenharmony_ci let promisequerygoPrev = rdbStore.query(predicatesgoPrev, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 270e41f4b71Sopenharmony_ci promisequerygoPrev.then((resultSet) => { 271e41f4b71Sopenharmony_ci resultSet.goToPreviousRow(); 272e41f4b71Sopenharmony_ci resultSet.close(); 273e41f4b71Sopenharmony_ci }).catch((err) => { 274e41f4b71Sopenharmony_ci console.log('query failed'); 275e41f4b71Sopenharmony_ci }); 276e41f4b71Sopenharmony_ci ``` 277e41f4b71Sopenharmony_ci 278e41f4b71Sopenharmony_ci### getBlob 279e41f4b71Sopenharmony_ci 280e41f4b71Sopenharmony_cigetBlob(columnIndex: number): Uint8Array 281e41f4b71Sopenharmony_ci 282e41f4b71Sopenharmony_ciObtains the value in the specified column in the current row as a byte array. 283e41f4b71Sopenharmony_ci 284e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 285e41f4b71Sopenharmony_ci 286e41f4b71Sopenharmony_ci**Parameters** 287e41f4b71Sopenharmony_ci 288e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 289e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 290e41f4b71Sopenharmony_ci| columnIndex | number | Yes| Index of the specified column, starting from 0.| 291e41f4b71Sopenharmony_ci 292e41f4b71Sopenharmony_ci**Return value** 293e41f4b71Sopenharmony_ci 294e41f4b71Sopenharmony_ci| Type| Description| 295e41f4b71Sopenharmony_ci| -------- | -------- | 296e41f4b71Sopenharmony_ci| Uint8Array | Value in the specified column as a byte array.| 297e41f4b71Sopenharmony_ci 298e41f4b71Sopenharmony_ci**Example** 299e41f4b71Sopenharmony_ci 300e41f4b71Sopenharmony_ci ```js 301e41f4b71Sopenharmony_ci const codes = resultSet.getBlob(resultSet.getColumnIndex("CODES")); 302e41f4b71Sopenharmony_ci ``` 303e41f4b71Sopenharmony_ci 304e41f4b71Sopenharmony_ci### getString 305e41f4b71Sopenharmony_ci 306e41f4b71Sopenharmony_cigetString(columnIndex: number): string 307e41f4b71Sopenharmony_ci 308e41f4b71Sopenharmony_ciObtains the value in the specified column in the current row as a string. 309e41f4b71Sopenharmony_ci 310e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 311e41f4b71Sopenharmony_ci 312e41f4b71Sopenharmony_ci**Parameters** 313e41f4b71Sopenharmony_ci 314e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 315e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 316e41f4b71Sopenharmony_ci| columnIndex | number | Yes| Index of the specified column, starting from 0.| 317e41f4b71Sopenharmony_ci 318e41f4b71Sopenharmony_ci**Return value** 319e41f4b71Sopenharmony_ci 320e41f4b71Sopenharmony_ci| Type| Description| 321e41f4b71Sopenharmony_ci| -------- | -------- | 322e41f4b71Sopenharmony_ci| string | Value in the specified column as a string.| 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ci**Example** 325e41f4b71Sopenharmony_ci 326e41f4b71Sopenharmony_ci ```js 327e41f4b71Sopenharmony_ci const name = resultSet.getString(resultSet.getColumnIndex("NAME")); 328e41f4b71Sopenharmony_ci ``` 329e41f4b71Sopenharmony_ci 330e41f4b71Sopenharmony_ci### getLong 331e41f4b71Sopenharmony_ci 332e41f4b71Sopenharmony_cigetLong(columnIndex: number): number 333e41f4b71Sopenharmony_ci 334e41f4b71Sopenharmony_ciObtains the value in the specified column in the current row as a Long integer. 335e41f4b71Sopenharmony_ci 336e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 337e41f4b71Sopenharmony_ci 338e41f4b71Sopenharmony_ci**Parameters** 339e41f4b71Sopenharmony_ci 340e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 341e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 342e41f4b71Sopenharmony_ci| columnIndex | number | Yes| Index of the specified column, starting from 0.| 343e41f4b71Sopenharmony_ci 344e41f4b71Sopenharmony_ci**Return value** 345e41f4b71Sopenharmony_ci 346e41f4b71Sopenharmony_ci| Type| Description| 347e41f4b71Sopenharmony_ci| -------- | -------- | 348e41f4b71Sopenharmony_ci| number | Value in the specified column as a Long integer.<br>The value range supported by this API is **Number.MIN_SAFE_INTEGER** to **Number.MAX_SAFE_INTEGER**. If the value is out of this range, use [getDouble](#getdouble).| 349e41f4b71Sopenharmony_ci 350e41f4b71Sopenharmony_ci**Example** 351e41f4b71Sopenharmony_ci 352e41f4b71Sopenharmony_ci ```js 353e41f4b71Sopenharmony_ci const age = resultSet.getLong(resultSet.getColumnIndex("AGE")); 354e41f4b71Sopenharmony_ci ``` 355e41f4b71Sopenharmony_ci 356e41f4b71Sopenharmony_ci### getDouble 357e41f4b71Sopenharmony_ci 358e41f4b71Sopenharmony_cigetDouble(columnIndex: number): number 359e41f4b71Sopenharmony_ci 360e41f4b71Sopenharmony_ciObtains the value in the specified column in the current row as a double. 361e41f4b71Sopenharmony_ci 362e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 363e41f4b71Sopenharmony_ci 364e41f4b71Sopenharmony_ci**Parameters** 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 367e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 368e41f4b71Sopenharmony_ci| columnIndex | number | Yes| Index of the specified column, starting from 0.| 369e41f4b71Sopenharmony_ci 370e41f4b71Sopenharmony_ci**Return value** 371e41f4b71Sopenharmony_ci 372e41f4b71Sopenharmony_ci| Type| Description| 373e41f4b71Sopenharmony_ci| -------- | -------- | 374e41f4b71Sopenharmony_ci| number | Value in the specified column as a double.| 375e41f4b71Sopenharmony_ci 376e41f4b71Sopenharmony_ci**Example** 377e41f4b71Sopenharmony_ci 378e41f4b71Sopenharmony_ci ```js 379e41f4b71Sopenharmony_ci const salary = resultSet.getDouble(resultSet.getColumnIndex("SALARY")); 380e41f4b71Sopenharmony_ci ``` 381e41f4b71Sopenharmony_ci 382e41f4b71Sopenharmony_ci### isColumnNull 383e41f4b71Sopenharmony_ci 384e41f4b71Sopenharmony_ciisColumnNull(columnIndex: number): boolean 385e41f4b71Sopenharmony_ci 386e41f4b71Sopenharmony_ciChecks whether the value in the specified column of the current row is null. 387e41f4b71Sopenharmony_ci 388e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 389e41f4b71Sopenharmony_ci 390e41f4b71Sopenharmony_ci**Parameters** 391e41f4b71Sopenharmony_ci 392e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Description| 393e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 394e41f4b71Sopenharmony_ci| columnIndex | number | Yes| Index of the specified column, starting from 0.| 395e41f4b71Sopenharmony_ci 396e41f4b71Sopenharmony_ci**Return value** 397e41f4b71Sopenharmony_ci 398e41f4b71Sopenharmony_ci| Type| Description| 399e41f4b71Sopenharmony_ci| -------- | -------- | 400e41f4b71Sopenharmony_ci| boolean | Returns **true** if the value is null; returns **false** otherwise.| 401e41f4b71Sopenharmony_ci 402e41f4b71Sopenharmony_ci**Example** 403e41f4b71Sopenharmony_ci 404e41f4b71Sopenharmony_ci ```js 405e41f4b71Sopenharmony_ci const isColumnNull = resultSet.isColumnNull(resultSet.getColumnIndex("CODES")); 406e41f4b71Sopenharmony_ci ``` 407e41f4b71Sopenharmony_ci 408e41f4b71Sopenharmony_ci### close 409e41f4b71Sopenharmony_ci 410e41f4b71Sopenharmony_ciclose(): void 411e41f4b71Sopenharmony_ci 412e41f4b71Sopenharmony_ciCloses this result set. 413e41f4b71Sopenharmony_ci 414e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 415e41f4b71Sopenharmony_ci 416e41f4b71Sopenharmony_ci**Example** 417e41f4b71Sopenharmony_ci 418e41f4b71Sopenharmony_ci ```js 419e41f4b71Sopenharmony_ci let predicatesClose = new dataRdb.RdbPredicates("EMPLOYEE"); 420e41f4b71Sopenharmony_ci let promiseClose = rdbStore.query(predicatesClose, ["ID", "NAME", "AGE", "SALARY", "CODES"]); 421e41f4b71Sopenharmony_ci promiseClose.then((resultSet) => { 422e41f4b71Sopenharmony_ci resultSet.close(); 423e41f4b71Sopenharmony_ci }).catch((err) => { 424e41f4b71Sopenharmony_ci console.log('resultset close failed'); 425e41f4b71Sopenharmony_ci }); 426e41f4b71Sopenharmony_ci ``` 427