Cursor.insertRow()

NES2+Syntax

							cursor.insertRow(table)

Description

The insertRow() method of the Cursor object uses an updateable cursor and inserts a new row in the specified table of the cursor object. If the insert was successful, 0 is returned; otherwise, it returns an error code that can be obtained by using the majorErrorCode() and majorErrorMessage() methods of the Connection or database objects.

Note

Depending on your database, you may have to close the current cursor and reopen it if you want to access a newly inserted row. Also, if the next() method has been called on the cursor, any columns you do not specify values for will get the same values as the current row.

Example

Listing 8.33 creates a Cursor object and selects all rows. ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.