<doc>
  <legacy_id>2103</legacy_id>
  <name>revDatabaseColumnTypes</name>
  <type>function</type>
  <syntax>
    <example>revDatabaseColumnTypes(<i>recordSetID</i>)</example>
  </syntax>
  <library>Database library</library>
  <objects>
  </objects>
  <synonyms>
    <synonym>revdb_columntypes</synonym>
  </synonyms>
  <classification>
  </classification>
  <references>
    <function tag="revDatabaseType">revDatabaseType Function</function>
    <function tag="revDatabaseColumnLengths">revDatabaseColumnLengths Function</function>
    <function tag="revDatabaseColumnNames">revDatabaseColumnNames Function</function>
  </references>
  <history>
    <introduced version="1.1.1">Added.</introduced>
    <changed version="2.0"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
    <disk access="???"/>
    <network/>
  </security>
  <summary><glossary tag="return">Returns</glossary> the data types of the columns in a <glossary tag="record set (database cursor)">record set (database cursor)</glossary>.</summary>
  <examples>
    <example>revDatabaseColumnTypes(the savedCursor of field 1)</example>
    <example>if "BLOB" is among the items of revDatabaseColumnTypes(myCursor) then</p><p>  put true into preferQueryBlob</p><p>end if</example>
  </examples>
  <description>
    <p>Use the <b>revDatabaseColumnTypes</b> <control_st tag="function">function</control_st> to find out the data type of a <glossary tag="database field">database field</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>recordSetID</i> is the number returned by the <function tag="revQueryDatabase">revQueryDatabase function</function> when the <glossary tag="record set (database cursor)">record set</glossary> was created.</p><p/><p><b>Value:</b></p><p>The <b>revDatabaseColumnTypes</b> <control_st tag="function">function</control_st> returns a list of data types, one for each <glossary tag="column">column</glossary> in the <glossary tag="record set (database cursor)">record set</glossary>, separated by commas.</p><p/><p><b>Comments:</b></p><p>The possible data types are:</p><p>        * BIT</p><p>        * CHAR</p><p>        * STRING</p><p>        * WSTRING</p><p>        * BLOB (short for binary large object)</p><p>        * TIMESTAMP</p><p>        * DATE</p><p>        * TIME</p><p>        * DATETIME</p><p>        * FLOAT</p><p>        * DOUBLE</p><p>        * INTEGER</p><p>        * SMALLINT</p><p>        * WORD</p><p>        * BOOLEAN</p><p>        * LONG</p><p/><p>You can use the <b>revDatabaseColumnTypes</b> <control_st tag="function">function</control_st> to find out what kind of data you need to be prepared for. For example, if <glossary tag="BLOB">BLOB</glossary> is one of the data types, that <glossary tag="column">column</glossary> is <glossary tag="binary data">binary data</glossary>, so you should not attempt to display it in a <keyword tag="field">field</keyword>.</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revDatabaseColumnTypes</b> <control_st tag="function">function</control_st> is part of the <glossary tag="Database library">Database library</glossary>. To ensure that the <control_st tag="function">function</control_st> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure the "Database Support" checkbox is checked and the database drivers you are using are selected in the list of database drivers.</p><p/><p><b>Changes:</b></p><p>The <b>revDatabaseColumnTypes</b> synonym was added in version 2.0.</p><p/><p><b>Note:</b> revDatabaseColumnTypes returns storage classes instead of data types for SQLite. Columns can be defined with any data type, but internally SQLite stores them as one of only four storage classes. You can get the defined data types using the following SQL syntax: SELECT sql FROM sqlite_master WHERE name = 'my_table';</p>
  </description>
</doc>