Result
DeleteRow
delete a row from the table
Calling Sequence
Parameters
Description
Examples
result:-DeleteRow( )
result
-
Result module
DeleteRow removes the row indicated by the row cursor from the database.
The row cursor can be moved by calling Next, Previous, First, Last, and GotoRow.
Not all Result modules can be updated. Only Result modules representing tables containing data from a single table (no joins) and a column of primary keys are guaranteed to be updatable. Particular JDBC Drivers and databases may allow a wider range of updatable tables and thus Result modules.
driver≔DatabaseLoadDriver:
conn≔driver:-OpenConnectionurl,name,pass:res≔conn:-ExecuteQuerySELECT id,name,number,mass FROM animals:res:-ToMapleoutput=Array
1fish1000.01000000000000000022dog1020.50000000000000003cat105.500000000000000004rat500.5000000000000000005horse3400.3000000000000116snake17.750000000000000007lizard50.1000000000000000048parrot202.9pig410.10hamster300.200000000000000012
res:-First
true
res:-GetRowIndex
1
res:-GetDataid
res:-DeleteRow;res:-First
res:-ToMapleoutput=Array
2dog1020.50000000000000003cat105.500000000000000004rat500.5000000000000000005horse3400.3000000000000116snake17.750000000000000007lizard50.1000000000000000048parrot202.9pig410.10hamster300.200000000000000012
res:-GotoRow5
5
6
2dog1020.50000000000000003cat105.500000000000000004rat500.5000000000000000005horse3400.3000000000000117lizard50.1000000000000000048parrot202.9pig410.10hamster300.200000000000000012
res:-GotoRow7
7
9
res:-DeleteRow;res≔conn:-ExecuteQuerySELECT id,name,number,mass FROM animals:res:-ToMapleoutput=Array
2dog1020.50000000000000003cat105.500000000000000004rat500.5000000000000000005horse3400.3000000000000117lizard50.1000000000000000048parrot202.10hamster300.200000000000000012
See Also
Database
Database[Connection][ExecuteQuery]
Database[PreparedStatement][Execute]
Database[Result]
Database[Result][First]
Database[Result][GotoRow]
Database[Result][Last]
Database[Result][Next]
Database[Result][Previous]
Database[Statement]
Database[Statement][Execute]
Database[usage]
Download Help Document