SqlBindJson(sqlquery, string, json)

From NWN Lexicon
Jump to navigationJump to 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 an json to a named parameter of the given prepared query.

void SqlBindJson(
    sqlquery sqlQuery,
    string sParam,
    json jValue
);


Parameters

sqlQuery
a prepared sql query
sParam
named parameter
jValue
json to bind


Description

Bind an json to a named parameter of the given prepared query.


Remarks

Json values are serialised into a string.


Version

This function was added in 1.85.8193.31 of NWN:EE.


Example

From nwscript:

  sqlquery v = SqlPrepareQueryObject(GetModule(), "insert into test (col) values (@myjson);");
  SqlBindJson(v, "@myjson", myJsonObject);
  SqlStep(v);


Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.


See Also

functions:

JSON Functions