Difference between revisions of "SqlGetFloat"

From NWN Lexicon
Jump to: navigation, search
(Created page with "{{NWNEE}}{{DISPLAYTITLE:SqlGetFloat(sqlquery, float)}}__NOTOC__ Retrieve a column cast as a float of the currently stepped row. <nwscript> void SqlStep( sqlquery sqlQuery,...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{NWNEE}}{{DISPLAYTITLE:SqlGetFloat(sqlquery, float)}}__NOTOC__
+
{{NWNEE}}{{DISPLAYTITLE:SqlGetFloat(sqlquery, int)}}__NOTOC__
 
Retrieve a column cast as a float of the currently stepped row.
 
Retrieve a column cast as a float of the currently stepped row.
 
<nwscript>
 
<nwscript>
void SqlStep(
+
float SqlGetFloat(
 
     sqlquery sqlQuery,
 
     sqlquery sqlQuery,
 
     int nIndex
 
     int nIndex
Line 24: Line 24:
  
 
In traditional fashion, nIndex starts at 0.
 
In traditional fashion, nIndex starts at 0.
 +
  
 
===Remarks===
 
===Remarks===
  
 +
Use this to retrieve data from a select SQL query.
  
  
 
===Version===
 
===Version===
  
{{8193.14}}
+
{{patchnwnee|patch=1.80.8193.14|link=https://steamcommunity.com/games/704450/announcements/detail/2724067792533337541}}
 +
 
  
 
===Example===
 
===Example===
Line 49: Line 52:
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
|
 
|
[[SqlPrepareQueryCampaign]] [[SqlPrepareQueryObject]] [[SqlGetFloat]] [[SqlGetString]] [[SqlGetVector]] [[SqlGetObject]]
+
[[SqlPrepareQueryCampaign]] [[SqlPrepareQueryObject]] [[SqlGetInt]] [[SqlGetString]] [[SqlGetVector]] [[SqlGetObject]]
 
|}
 
|}
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:SQL Functions]]
 
[[Category:SQL Functions]]

Latest revision as of 23:40, 13 March 2021

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.

Retrieve a column cast as a float of the currently stepped row.

float SqlGetFloat(
    sqlquery sqlQuery,
    int nIndex
);

Parameters

sqlQuery
An already prepared SQL query
nIndex
Index of the float to retrieve

Description

Retrieve a column cast as a float of the currently stepped row.

You can call this after SqlStep() returned TRUE.

In case of error, 0 will be returned.

In traditional fashion, nIndex starts at 0.


Remarks

Use this to retrieve data from a select SQL query.


Version

This function was added in 1.80.8193.14 of NWN:EE.


Example

    // "Widget" is cast as a float
    sqlquery n = SqlPrepareQueryObject(GetFirstPC(), "select widget from widgets;");
    while (SqlStep(n))
    {
        SendMessageToPC(GetFirstPC(), "Found widget float: " + FloatToString(SqlGetFloat(n, 0)));
    }

See Also

functions:

SqlPrepareQueryCampaign SqlPrepareQueryObject SqlGetInt SqlGetString SqlGetVector SqlGetObject