<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css">
<title>
Gambas Documentation - .TableFields.Add
 (gb.db)</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../../../help+en"><img class="flag" alt="Home" border="0" src="../../../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../_tablefields+en">Up</a>&nbsp;
<a href="../_tablefields+en">Previous</a>&nbsp;
<a href="../_tableindexes+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
.TableFields.Add
 (gb.db)</h1>
<div class="black"><font size="-2"><b>Syntax</b></font></div>
<pre class="syntax"><font color="blue">SUB</font> <b>Add</b> <font color="blue">(</font> <u>Name</u> <font color="blue">AS</font> <font color="#0080FF">String</font><font color="blue">,</font> <u>Type</u> <font color="blue">AS</font> <font color="#0080FF">Integer</font> <b>[</b> <font color="blue">,</font> <u>Length</u> <font color="blue">AS</font> <font color="#0080FF">Integer</font><font color="blue">,</font> <u>Default</u> <font color="blue">AS</font> <font color="#0080FF">Variant</font> <b>]</b> <font color="blue">)</font></pre>
Add a field into a table being created.
<p>
<ul>
<li><u>Name</u> is the name of the field.
<li><u>Type</u> is its datatype.
<li><u>Length</u> is the maximum length of the field. It is used only for <a href="../../../lang/type/string+en">String</a> fields.
<li><u>Default</u> is an optional default value. If not specified, the default value is <a href="../../../lang/null+en">NULL</a>.
<p>
</ul>

The possible field datatypes are:
<ul>
<li><a href="../../gb/gb+en">gb</a>.<a href="../../gb/gb/integer+en">Integer</a>
<li><a href="../../gb/gb+en">gb</a>.<a href="../../gb/gb/float+en">Float</a>
<li><a href="../../gb/gb+en">gb</a>.<a href="../../gb/gb/boolean+en">Boolean</a>
<li><a href="../../gb/gb+en">gb</a>.<a href="../../gb/gb/string+en">String</a>
<li><a href="../../gb/gb+en">gb</a>.<a href="../../gb/gb/date+en">Date</a>
</ul>

</div>
</body>
</html>

