/usr/share/gtk-doc/html/libgda-4.0/howto-meta2.html is in libgda-4.0-doc 4.2.8-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Update the meta data about a table</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GNOME Data Access 4 manual">
<link rel="up" href="howto.html" title="HOWTO for common tasks">
<link rel="prev" href="howto-meta1.html" title="Get information about a table's columns">
<link rel="next" href="ch11s11.html" title="Validate a DML statement">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="howto-meta1.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="howto.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNOME Data Access 4 manual</th>
<td><a accesskey="n" href="ch11s11.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="howto-meta2"></a>Update the meta data about a table</h2></div></div></div>
<p>
For a general overview of the mete data problem, see the
Get information about a table's columns section. Updating the meta data
can be done by calling
<a class="link" href="GdaConnection.html#gda-connection-update-meta-store" title="gda_connection_update_meta_store ()">gda_connection_update_meta_store()</a> with a %NULL
"context" argument, but this
call updates the whole meta data which will always do the job, but sometimes one knows that only a
part of the meta data need to be updated. Here is an example of how to use a specific
<a class="link" href="GdaMetaStore.html#GdaMetaContext" title="GdaMetaContext">GdaMetaContext</a> argument.
</p>
<p>
Specifically the following code
updates the meta data regarding the "customers" table:
</p>
<pre class="programlisting">
GdaConnection *connection=...
GError *error = NULL;
GdaMetaContext mcontext = {"_tables", 1, NULL, NULL};
gboolean result;
mcontext.column_names = g_new (gchar *, 1);
mcontext.column_names[0] = "table_name";
mcontext.column_values = g_new (GValue *, 1);
g_value_take_string ((mcontext.column_values[0] = gda_value_new (G_TYPE_STRING)),
gda_sql_identifier_quote ("customers"));
result = gda_connection_update_meta_store (connection, &mcontext, &error);
gda_value_free (mcontext.column_values[0]);
if (!result) {
/* handle the error */
g_error_free (error);
}
</pre>
<p>
</p>
<p>
An important note about the <a class="link" href="GdaSqlParser.html#gda-sql-identifier-quote" title="gda_sql_identifier_quote ()">gda_sql_identifier_quote()</a> call
which has been added to ensure
that the contents of <code class="code">mcontext.column_values</code> values is
conform to the convention used by the <a class="link" href="GdaMetaStore.html" title="GdaMetaStore">GdaMetaStore</a>
to represent SQL identifiers when the
values represent an SQL identifier (which is the case in the example above). For more information,
see the <a class="link" href="information_schema.html#information_schema:sql_identifiers" title="SQL identifiers">meta data section about SQL identifiers</a>.
</p>
<p>
Even though not strictly necessary, it can safely be used all the time.
For example if the table name for which a meta data update is requested had been <span class="emphasis"><em>"Customers"</em></span>
(note the upper case C at the beginning and the double quotes) because this is how the database know it, then
not using <a class="link" href="GdaSqlParser.html#gda-sql-identifier-quote" title="gda_sql_identifier_quote ()">gda_sql_identifier_quote()</a> may not have done as
expected.
</p>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.17</div>
</body>
</html>
|