Add example code for data_control_sql_set_data_id 73/75473/1 accepted/tizen/common/20160622.150009 accepted/tizen/ivi/20160623.121958 accepted/tizen/mobile/20160623.121922 accepted/tizen/tv/20160623.121928 accepted/tizen/wearable/20160623.121942 submit/tizen/20160622.083438
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 20 Jun 2016 05:27:29 +0000 (14:27 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 20 Jun 2016 05:29:12 +0000 (14:29 +0900)
Change-Id: I4124e32dd5c19d962c364f4bf7cb31175b5826c6
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
include/data_control_sql.h

index 00cf733d7f8f8967b1d1f657828e14aa7d3c9620..f8b9fcddbd7f4b110e2a47de98bfe154cbb4c836 100644 (file)
@@ -231,6 +231,37 @@ int data_control_sql_get_provider_id(data_control_h provider, char **provider_id
  * @brief  Sets the data ID.
  * @since_tizen 2.3
  *
+ * @code
+ *
+ *     {
+ *             bundle *b;
+ *             int ret;
+ *
+ *             // Insert data to Note table
+ *             ret = data_control_sql_set_data_id(ad->provider_h, "Note");
+ *             if (ret != DATA_CONTROL_ERROR_NONE)
+ *                     dlog_print(DLOG_ERROR, LOG_TAG, "setting data id failed with error: %d", ret);
+ *
+ *             b = bundle_create();
+ *             bundle_add_str(b, ""TITLE"", "test");
+ *             bundle_add_str(b, "CONTENTS", "test contents");
+ *             data_control_sql_insert(ad->provider_h, b, &req_id);
+ *             bundle_free(b);
+ *
+ *             // Insert data to Dictionary table
+ *             ret = data_control_sql_set_data_id(ad->provider_h, "Dictionary");
+ *             if (ret != DATA_CONTROL_ERROR_NONE)
+ *                     dlog_print(DLOG_ERROR, LOG_TAG, "setting data id failed with error: %d", ret);
+ *
+ *             b = bundle_create();
+ *             bundle_add_str(b, "WORD", "test");
+ *             bundle_add_str(b, "WORD_DESC", "test desc");
+ *             data_control_sql_insert(ad->provider_h, b, &req_id);
+ *             bundle_free(b);
+ *     }
+ *
+ * @endcode
+ *
  * @param[in]  provider  The provider handle
  * @param[in]  data_id   A string for identifying a specific table to operate \n
  *                       The string consists of one or more components separated by a slash('/').