SqlBindVector(sqlquery, string, vector)

From NWN Lexicon
Jump to: navigation, search
Nwnee logo.jpg Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Bind a vector to a named parameter of the given prepared query.

void SqlBindString(
    sqlquery sqlQuery,
    string sParam,
    vector vVector
);

Parameters

sqlQuery
An already prepared SQL query
sParam
Parameter referenced in sqlQuery to bind
vVector
Vector value to bind

Description

Bind a vector to a named parameter of the given prepared query.

Remarks

This allows much easier inputting of variables into a pre-prepared query, removing the need for a large amount of string parsing to simply update certain variables of a query.

You utilise this by defining the parameter to alter in the prepared query, and reference it as the sParam part.

Note vectors are only part of a location. A full location is made up of a vector, facing (0-360 float) and area object. To store a full location you'll need all of these (with the area being stored with a string referencing its tag, or using ObjectToString/StringToObject).

Version

This function was added in 1.80.8193.14 of NWN:EE.

Example

    sqlquery v = SqlPrepareQueryObject(GetModule(), "insert into test (col) values (@myint);");
    vector vVector = Vector(1.0f, 2.0f, 3.0f);
    SqlBindVector(v, "@myint", vVector);
    SqlStep(v);

See Also

functions:

SqlPrepareQueryCampaign SqlPrepareQueryObject SqlBindInt SqlBindFloat SqlBindString SqlBindObject