SQL.SetParamAsContainer
-----------------------

Sets parameter's value as BLOB value with data from a container.

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

MBS( "SQL.SetParamAsContainer"; Command; Param; Value ) 

**MBS**( **"SQL.SetParamAsContainer";** /\* Sets parameter's value as BLOB value with data from a container. \*/  
**$Command**; /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/   
**$Param**; /\* The parameter name or ID. Pass number for ID, a text with parameter name or the index with # prefix. e.g. "#0" for first parameter.e.g. "1" \*/   
**$Value**) /\* The new valuee.g. $image \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |
| Param | The parameter name or ID. Pass number for ID, a text with parameter name or the index with # prefix. e.g. "#0" for first parameter. | "1" |
| Value | The new value | $image |

### Result

Returns "OK" or error message.

### Description

Sets parameter's value as BLOB value with data from a container.  
### Examples

Set parameter with ID = 1 to image

 MBS ("[SQL.SetParamAsText](SQLSetParamAsText.md)"; $Command ; 1; $image )  
Set parameter JPEGData with image:

 MBS ("[SQL.SetParamAsText](SQLSetParamAsText.md)"; $Command ; "JPEGData"; $image )  
Update BLOB field:

 #Create update command to fill blob field:   
Set Variable \[ $Command ; Value:MBS ("[SQL.NewCommand](SQLNewCommand.md)"; $Connection ; "UPDATE 'Test' SET MyBlob=:image WHERE ID=:id") \]  
Set Variable \[ $result ; Value:MBS ("[SQL.SetParamAsText](SQLSetParamAsText.md)"; $Command ; "id"; 123 \]  
Set Variable \[ $result ; Value:MBS ("SQL.SetParamAsContainer"; $Command ; "image"; MyTable::MyImage ) \]  
\#Run it   
Set Variable \[ $result ; Value:MBS ("[SQL.Execute](SQLExecute.md)"; $Command ) \]  
\#Cleanup   
Set Variable \[ $result2 ; Value:MBS ("[SQL.Commit](SQLCommit.md)"; $Connection ) \]  
Set Variable \[ $result2 ; Value:MBS ("[SQL.FreeCommand](SQLFreeCommand.md)"; $Command ) \]  
### See also

- [SQL.Commit](SQLCommit.md)
- [SQL.Execute](SQLExecute.md)
- [SQL.FreeCommand](SQLFreeCommand.md)
- [SQL.GetFieldAsContainer](SQLGetFieldAsContainer.md)
- [SQL.GetParamAsContainer](SQLGetParamAsContainer.md)
- [SQL.NewCommand](SQLNewCommand.md)
- [SQL.SetParamAsText](SQLSetParamAsText.md)

### Release notes

- **Version 15.3**
    - Fixed an issue with [SQL.SetParamAsContainer](https://www.mbsplugins.eu/SQLSetParamAsContainer.shtml) and Firebird.

### Example Databases

- [SQL to other databases/SQLite blob](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/SQLite%20blob.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.3pr1](https://www.mbsplugins.de/archive/2025-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.0pr3](https://www.mbsplugins.de/archive/2012-10-19/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 22nd November 2018

  
[SQL.SetParamAsBoolean](SQLSetParamAsBoolean.md) - [SQL.SetParamAsDate](SQLSetParamAsDate.md)

[HTML Version](SQLSetParamAsContainer.shtml)