revDatabaseColumnNamed |
Type | function |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | revDatabaseColumnNamed(<recordSetID>, <columnName> [, <holderVariable>])
|
Associations | database library |
Summary | Returns data from a specified database field in a database.
|
Introduced | 1.1 |
Changes | The ability to specify array elements as holder variables was added in
version 2.9
|
OS | mac, windows, linux, ios, android |
Platforms | desktop, server, mobile |
Parameters | Name | Type | Description |
---|
recordSetID | | The number returned by the revQueryDatabase function when the record set
was created.
|
columnName | | The name of a database field.
|
holderVariable | | A valid variable name or the name of an array element.
|
|
Example | revDatabaseColumnNamed(myResults,"LASTNAME")
revDatabaseColumnNamed(zipSearch,"CARRIER","foundCarriers")
revDatabaseColumnNamed(tCursor, "id", "tRetrievedDataArray[id]")
|
Values | Name | Type | Description |
---|
return | | The revDatabaseColumnNamed function returns the text from the
specified field of the current record if no holderVariable is
specified. If a holderVariable is specified the function returns empty
if successful, an error string otherwise.
|
|
Related | Keyword: string
Control Structure: function
Function: revDatabaseColumnNames, revDatabaseColumnLengths, revDatabaseColumnNumbered
Library: Database library
Glossary: LiveCode custom library, return, variable, database, record set, record, Standalone Application Settings, standalone application, database field
|
Security | disk, network |
Description | Use the revDatabaseColumnNamed function to obtain the contents of a
given database field, in the current record of the specified
record set (glossary).
If you specify a holderVariable, the data is placed in that
variable. Otherwise, the data is returned by the function.
To retrieve binary data from the database, a holder variable must be
specified, otherwise the revDatabaseColumnNamed function may return
truncated data. This is due to limitations in the current architecture.
If the attempt to get the data is not successful, the
revDatabaseColumnNamed function returns an error message that begins
with the string "revdberr".
Important: The revDatabaseColumnNamed function is part of the
Database library. To ensure that the function works in a
standalone application, you must include this
custom library when you create your
standalone. In the Inclusions pane of the
Standalone Application Settings window, make sure both the
"Database" library checkbox and those of the database drivers you are
using are checked.
Important: The name of the holderVariable must be a quoted string.
If the holderVariable is in an array, the key must either not be
a variable itself or separated from the quoted parts. For example,
if the i in tArray[i] were itself a variable, holderVariable
would have to be written as:
"tArray[" & i & "]"
|
Tags | database |