SQCloudRowsetDump
void SQCloudRowsetDump (SQCloudResult *result, uint32_t maxline, bool quiet);
Description
Print the Rowset on standard output.
Parameters
- result: A valid SQCloudResult pointer returned by an SQCloud function.
- maxline: The maximum number of characters to print on each column
- quiet: If
true
do not print timinig information
Return value
None.
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");
}
// choose a database first (no error check here)
SQCloudResult *r1 = SQCloudExec(conn, "USE DATABASE mydatabase.sqlite;");
SQCloudResultFree(r1);
// perform a sample query
SQCloudResult *r = SQCloudExec(conn, "SELECT * FROM mytable;");
// dump result
SQCloudRowsetDump(r, 0, false);
SQCloudResultFree(r);
}