SQL.GetFieldValueList
---------------------

Queries list of field values.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.GetFieldValueList"; Command ) 

**MBS**( **"SQL.GetFieldValueList";** /\* Queries list of field values. \*/  
**$Command**) /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |

### Result

Returns list or error.

### Description

Queries list of field values.  
If value contains a new line or return character, we replace it with \\n or \\r.  
### Examples

Create a command, fill parameters and query names and values list:

 #Create select   
Set Variable \[$Command ; Value:MBS ("[SQL.NewCommand](SQLNewCommand.md)"; $Connection ; "SELECT \* FROM Test")\]  
\#Run it   
Set Variable \[$result ; Value:MBS ("[SQL.Execute](SQLExecute.md)"; $Command )\]  
\#get first row of result   
Set Variable \[$result ; Value:MBS ("[SQL.FetchNext](SQLFetchNext.md)"; $Command )\]  
\# Now query field names   
Set Variable \[$FieldNames ; Value:MBS ("[SQL.GetFieldNameList](SQLGetFieldNameList.md)"; $Command )\]  
\# and field values of first row   
Set Variable \[$FieldValues ; Value:MBS ("SQL.GetFieldValueList"; $Command )\]  
### See also

- [SQL.Execute](SQLExecute.md)
- [SQL.FetchNext](SQLFetchNext.md)
- [SQL.GetFieldName](SQLGetFieldName.md)
- [SQL.GetFieldNameList](SQLGetFieldNameList.md)
- [SQL.GetFieldValue](SQLGetFieldValue.md)
- [SQL.GetParamValueList](SQLGetParamValueList.md)
- [SQL.NewCommand](SQLNewCommand.md)

### Release notes

- **Version 8.5**
    - Fixed bug in [SQL.GetFieldValueList](http://www.mbsplugins.eu/SQLGetFieldValueList.shtml) with empty texts being ignored in first field.

### Example Databases

- [SQL to other databases/Microsoft Access Execute](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/Microsoft%20Access%20Execute.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 8.5pr1](https://www.mbsplugins.de/archive/2018-10-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.1pr4](https://www.mbsplugins.de/archive/2015-04-08/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2016, Seite 28](https://filemaker-magazin.de/neuigkeit/3876-Appetithappen-FMM_201604)
- [Ausgabe 3/2016, Seite 30](https://filemaker-magazin.de/neuigkeit/3883-Appetithappen-FMM_201603)

This function is free to use.

Created 8th April 2015 , last changed 8th April 2015

  
[SQL.GetFieldValue](SQLGetFieldValue.md) - [SQL.GetFieldsAsJSON](SQLGetFieldsAsJSON.md)

[HTML Version](SQLGetFieldValueList.shtml)