0

First part: I have a dataController with UIAPP that can make simple database operations that are mentioned in datacontroller doc. However I need to access data table row count, I'm inserting data with AUTO_INCREMENT KEY. So I want to access all elements and dump table when done. In mysql server I can SELECT COUNT(*) FROM dbo.bigTransactionHistory; to access rows count. But I do not see how to do that with datacontroller provider.

So how can I get row counts of a table from database?

SECOND PART : And is there a way to execute any sqlite command with datacontroller provider? For example can we do this?

char* sql_command = "any command";
ret = sqlite3_exec(db, sql_command, NULL, NULL, NULL);

How can we access any function from data controller provider service to the UIAPP?

I'm asking second part because data_control_provider_sql_cb has limited number of execution functions.

Rifat
  • 1,700
  • 3
  • 20
  • 51

1 Answers1

0

First Part: You can use below API with 'NULL column_list', then you can select all columns

/**
 * @brief Creates SQL SELECT statement.
 *
 * @since_tizen 2.3
 *
 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
 * @param[in] provider The provider handle
 * @param[in] column_list The column names to query \n
 *                        Pass @c NULL if all columns need to be selected**
 * @param[in] column_count The total number of columns to be queried
 * @param[in] where A filter to select the desired rows
 * @param[in] order The sorting order of rows to query
 *
 * @return The SQL SELECT statement on success,
 *         otherwise NULL
 * @exception #DATA_CONTROL_ERROR_NONE Success
 * @exception #DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
 * @exception #DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
 */
char *data_control_provider_create_select_statement(data_control_h provider, const char **column_list, int column_count, const char *where, const char *order);

Second Part : You can use the Bulk API. Please refer to reference https://docs.tizen.org/application/native/api/mobile/5.5/group__CAPI__DATA__CONTROL__CONSUMER__MODULE.html#gaf8891d1ab8c938ada38f9668c2c9fa52