MCPcopy Create free account
hub / github.com/acl-dev/acl / tbl_insert

Function tbl_insert

lib_acl_cpp/samples/sqlite/sqlite.cpp:42–67  ·  view source on GitHub ↗

���ӱ�����

Source from the content-addressed store, hash-verified

40
41// ���ӱ�����
42static bool tbl_insert(acl::db_handle& db, int n)
43{
44 const char* sql_fmt = "insert into group_tbl('group_name', 'uvip_tbl')"
45 " values('���-%d', 'test')";
46
47 acl::string sql;
48 sql.format(sql_fmt, n);
49 if (db.sql_update(sql.c_str()) == false)
50 return (false);
51
52 const acl::db_rows* result = db.get_result();
53 if (result)
54 {
55 const std::vector<acl::db_row*>& rows = result->get_rows();
56 for (size_t i = 0; i < rows.size(); i++)
57 {
58 const acl::db_row* row = rows[i];
59 for (size_t j = 0; j < row->length(); j++)
60 printf("%s, ", (*row)[j]);
61 printf("\r\n");
62 }
63 }
64
65 db.free_result();
66 return (true);
67}
68
69// ��ѯ������
70static int tbl_select(acl::db_handle& db, int n)

Callers 1

runMethod · 0.70

Calls 8

get_rowsMethod · 0.80
free_resultMethod · 0.80
formatMethod · 0.45
sql_updateMethod · 0.45
c_strMethod · 0.45
get_resultMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…