Result
ToMaple
convert a result module into a Maple object
Calling Sequence
Parameters
Description
Examples
result:-ToMaple( opt )
result
-
Result module
opt
(optional) equation of the form output=boolean
ToMaple converts result into a Maple representation.
Which type ToMaple converts result into is determined by its optional parameter.
output = table, Array, or browser
For output=table, ToMaple returns the data as a two-dimensional Maple table. The table is indexed first by the row number and second by the column name. In the case that the result contains columns with the same name, the repeated column names will have their column index appended to their name, separated by a space.
For output=Array, ToMaple returns the data as a two-dimensional Array.
For output=browser, a Maplet application starts to display the data.
The default value is output=table.
ToMaple moves only the row cursor toward the last row in the table. Therefore if the row cursor is not on the first (or before first) row, some rows in the result will not be converted. To make sure that all the rows of result are included, position the row cursor at the first row by calling First.
Some care must be taken when calling ToMaple with a Result module containing large elements or a very large number of elements. It may require a large amount of memory to store the data.
Create a Result.
driver≔DatabaseLoadDriver⁡:
conn≔driver:-OpenConnection⁡url,name,pass:res≔conn:-ExecuteQuery⁡SELECT name,number FROM animals WHERE id BETWEEN 3 AND 7:
By default it converts to a table.
res:-ToMaple⁡
table⁡2,name=rat,5,number=5,3,number=3,3,name=horse,1,number=10,5,name=lizard,1,name=cat,4,number=1,2,number=50,4,name=snake
Move the cursor to the beginning of the result table.
res:-First⁡
true
Now convert to an Array.
res:-ToMaple⁡output=Array
cat10rat50horse3snake1lizard5
This time, move to the third row.
res:-GotoRow⁡3
Convert the remainder of the table to an Array.
horse3snake1lizard5
See Also
Database
Database[DataInterfaceStream]
Database[Result]
Database[Result][GotoRow]
Database[Result][Last]
Database[Result][Next]
Database[Result][Previous]
Database[Result][UpdateData]
Database[usage]
Download Help Document