Result
GetData
get the data stored in a column of the current row
Calling Sequence
Parameters
Description
Examples
result:-GetData( index, opt )
result
-
Result module
index
string or integer; the column from which to get the data
opt
(optional) equation of the form stream=boolean
GetData returns the data element in the row indicated by the row cursor and in the column index.
GetData accepts one optional argument that affects the format of the returned value.
stream = true or false
For some large binary and character elements it may be inconvenient or even impossible to transfer the entire object to Maple at once. By passing stream=true, GetData will return a DataInterfaceStream module instead of the object. The DataInterfaceStream module allows the data to be retrieved in pieces. stream=true is valid only for elements of type CHAR, VARCHAR, LONGVARCHAR, BINARY, VARBINARY, and LONGVARBINARY.
If index is an integer, it is the index of the column in the table. If index is a string, then it is the name of the column.
If the current row is not a data row, then an error is raised.
Using GetData and Next is the preferred method for walking the data of a Result module.
Create a Result.
driver≔DatabaseLoadDriver⁡:
conn≔driver:-OpenConnection⁡url,name,pass:res≔conn:-ExecuteQuery⁡SELECT id,name,number,mass FROM animals:res:-Next⁡
true
res:-GetData⁡1
1
res:-GetData⁡2
fish
res:-GetData⁡3
100
res:-GetData⁡4
0.0100000000000000002
res:-GetData⁡id
res:-GetData⁡name
res:-GetData⁡number
res:-GetData⁡mass
res≔conn:-ExecuteQuery⁡SELECT * FROM stream:res:-Next⁡
the quick brown fox jumped over the lazy dog
[ 1..127 1-D Array ]
[ Data Type: integer[1] ]
[ Storage: rectangular ]
[ Order: C_order ]
str≔res:-GetData⁡1,stream=true:str:-Read⁡5
the q
str:-Skip⁡5;str:-Read⁡5
brown
str≔res:-GetData⁡2,stream=true:str:-Read⁡5
1,2,3,4,5
11,12,13,14,15
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