Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

SQLPreparedStatementMBS.Bind(name As String, value as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 14.1 Yes Yes Yes Yes No
Function: Defines the value for one parameter.
Example:
dim db as SQLDatabaseMBS // your db connection
dim sql as string = "Insert into test_tbl(fid, fvarchar20) values(:fid, :fvarchar20)"
dim v as Variant = db.Prepare(sql)
dim p as SQLPreparedStatementMBS = v

p.BindType("fid", SQLPreparedStatementMBS.kTypeLong)
p.BindType("fvarchar20", SQLPreparedStatementMBS.kTypeString)
p.Bind("fid", 2345)
p.Bind("fvarchar20", "Hello World by name")

p.SQLExecute
Notes:
Version 16.4 and newer allow you to bind BLOB fields using a Memoryblock or a String value.
Older versions only accepted string.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Bind(name As String, value as Variant, type as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 14.1 Yes Yes Yes Yes No
Function: Defines one paramater with value and type.
Example:
dim db as SQLDatabaseMBS // your db connection
dim sql as string = "Insert into test_tbl(fid, fvarchar20) values(:fid, :fvarchar20)"
dim v as Variant = db.Prepare(sql)
dim p as SQLPreparedStatementMBS = v

p.Bind("fid", 2345, SQLPreparedStatementMBS.kTypeLong)
p.Bind("fvarchar20", "Hello World by name", SQLPreparedStatementMBS.kTypeString)

p.SQLExecute
Notes:
Version 16.4 and newer allow you to bind BLOB fields using a Memoryblock or a String value.
Older versions only accepted string.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

With plugin version 16.4 and newer binding type is optional. In that case the type is determinated from the value type.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Bind(Values as Dictionary)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 16.4 Yes Yes Yes Yes No
Function: Sets the parameters based on the keys and values in the dictionary.
Example:
dim db as SQLDatabaseMBS // your database
dim pic as Picture // some picture
dim jpegData as MemoryBlock = pic.GetData(Picture.FormatJPEG, 80)

// get an insert command
dim sql as string = "Insert into BlobTest(name, image) values (:name, :image)"
dim p as SQLPreparedStatementMBS = db.Prepare(sql)

// put parameter values in a dictionary
dim d as new Dictionary

// by param index
d.Value(0) = "logo.jpg"
// by param name
d.Value("image") = jpegData

// bind values and run it
p.Bind(d)
p.SQLExecute
Notes:
The dictionary is saved to fill parameters later.
Keys can be String, Text or numeric types. Text and String are used to pick parameters by name. Numeric values are used to pick parameter by index (zero based).
MemoryBlock and Strings without text encoding are converted to byte values (BLOB).
Texts and Strings with encoding are converted to text values.
Raises exceptions if you pass anything which is not recognized.
Other types are translated as good as possible.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Bind(values() as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Sets the value list with the given values.
Notes:
You can either pass values to the SQLExecute/SQLSelect method or call Bind methods to set values. You have to define for each parameter both the type and the value.

Version 16.4 and newer allow you to bind BLOB fields using a Memoryblock or a String value.
Older versions only accepted string.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Bind(zeroBasedIndex as Integer, value as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Defines the value for one parameter.
Notes:
You can either pass values to the SQLExecute/SQLSelect method or call Bind methods to set values. You have to define for each parameter both the type and the value.

Version 16.4 and newer allow you to bind BLOB fields using a Memoryblock or a String value.
Older versions only accepted string.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Bind(zeroBasedIndex as Integer, value as Variant, type as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Defines one paramater with value and type.
Notes:
You can either pass values to the SQLExecute/SQLSelect method or call Bind methods to set values. You have to define for each parameter both the type and the value.

Version 16.4 and newer allow you to bind BLOB fields using a Memoryblock or a String value.
Older versions only accepted string.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

With plugin version 16.4 and newer binding type is optional. In that case the type is determinated from the value type.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.BindType(name As String, type as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 14.1 Yes Yes Yes Yes No
Function: Defines the type of one value.
Example:
dim db as SQLDatabaseMBS // your db connection
dim sql as string = "Insert into test_tbl(fid, fvarchar20) values(:fid, :fvarchar20)"
dim v as Variant = db.Prepare(sql)
dim p as SQLPreparedStatementMBS = v

p.BindType("fid", SQLPreparedStatementMBS.kTypeLong)
p.BindType("fvarchar20", SQLPreparedStatementMBS.kTypeString)
p.Bind("fid", 2345)
p.Bind("fvarchar20", "Hello World by name")

p.SQLExecute
Notes: With plugin version 16.4 and newer binding type is optional. In that case the type is determinated from the value type.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.BindType(types() as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Defines the types for all values.
Notes:
You can either pass values to the SQLExecute/SQLSelect method or call Bind methods to set values. You have to define for each parameter both the type and the value.

With plugin version 16.4 and newer binding type is optional. In that case the type is determinated from the value type.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.BindType(zeroBasedIndex as Integer, type as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Defines the type of one value.
Notes:
You can either pass values to the SQLExecute/SQLSelect method or call Bind methods to set values. You have to define for each parameter both the type and the value.

With plugin version 16.4 and newer binding type is optional. In that case the type is determinated from the value type.

See also:

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Clear
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 14.1 Yes Yes Yes Yes No
Function: Clears all parameters for reusing the SQL Prepared statement.

Feedback, Comments & Corrections

SQLPreparedStatementMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: The private constructor.
Notes:
This constructor makes sure you don't create useless SQLPreparedStatementMBS objects by error. The only way to create an object is to use the prepare method in the database class.
This constructor is private to make sure you don't create an object from this class by error. Please use designated functions to create objects.

Feedback, Comments & Corrections

SQLPreparedStatementMBS.SQLExecute(ParamArray bindItems as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Runs the SQL command with the given parameters.
Notes:
You can decide whether you pass values here or call Bind methods.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

Feedback, Comments & Corrections

SQLPreparedStatementMBS.SQLExecuteMT(ParamArray bindItems as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 16.3 Yes Yes Yes Yes No
Function: Runs the SQL command with the given parameters.
Notes:
You can decide whether you pass values here or call Bind methods.

The work is performed on an extra thread, so this function can yield time to other Xojo (Real Studio) threads. And it calles the Working event regularly. For best user experience run this command on a Xojo (Real Studio) thread, so your GUI stays responsive.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

Feedback, Comments & Corrections

SQLPreparedStatementMBS.SQLSelect(ParamArray bindItems as Variant) As RecordSet
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 11.2 Yes Yes Yes Yes No
Function: Runs the query with the given parameters.
Notes:
Returns the recordset object or nil on error.
You can decide whether you pass values here or call Bind methods.

For this method to work, you need to have somewhere a property with SQLDatabaseMBS so Real Studio includes our SQLDatabase plugin which provides the RecordSet functionality.

The record set may not have a valid RecordCount or have working movefirst/movelast/moveprev methods unless the underlaying database supports those and Scrollable result sets is enabled/supported.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

Feedback, Comments & Corrections

SQLPreparedStatementMBS.SQLSelectMT(ParamArray bindItems as Variant) As RecordSet
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method SQL MBS SQL Plugin 16.3 Yes Yes Yes Yes No
Function: Runs the query with the given parameters.
Notes:
Returns the recordset object or nil on error.
You can decide whether you pass values here or call Bind methods.

For this method to work, you need to have somewhere a property with SQLDatabaseMBS so Real Studio includes our SQLDatabase plugin which provides the RecordSet functionality.

The record set may not have a valid RecordCount or have working movefirst/movelast/moveprev methods unless the underlaying database supports those and Scrollable result sets is enabled/supported.

The work is performed on an extra thread, so this function can yield time to other Xojo (Real Studio) threads. And it calles the Working event regularly. For best user experience run this command on a Xojo (Real Studio) thread, so your GUI stays responsive.

When passing variant for value, MemoryBlock and Strings without text encoding are converted to byte values (BLOB). Texts and Strings with encoding are converted to text values. Other types are translated as good as possible. Raises exceptions if you pass anything which is not recognized.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS SQL Plugin.





Links
MBS FileMaker Plugins