SQCloudResultInt32

int32_t SQCloudResultInt32 (SQCloudResult *result);

Description

If the result of the function SQCloudResultType is RESULT_INTEGER then use this function to retrieve an Int32 value.

Parameters

  • result: A valid SQCloudResult pointer returned by an SQCloud function.

Return value

An int32_t value.

Example

int main (int argc, const char * argv[]) {
    // setup config
    SQCloudConfig config = {0};
    config.username = "myusername";
    config.password = "mypassword"

    SQCloudConnection *conn = SQCloudConnect("myproject.sqlite.cloud", SQCLOUD_DEFAULT_PORT, &config);
    if (SQCloudIsError(conn)) {
        printf("ERROR connecting: %s (%d)\n", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));
        return -1;
    } else {
        printf("Connection to host OK...\n\n");
    }

    // execute a sample command
    SQCloudResult *r = SQCloudExec(conn, "GET INFO process_id;");
    int32_t value = SQCloudResultInt32(r);
    SQCloudResultFree(r);
}