<doc>
  <legacy_id>1068</legacy_id>
  <name>revDatabaseType</name>
  <type>function</type>
  <syntax>
    <example>revDatabaseType(<i>databaseID</i>)</example>
  </syntax>
  <library>Database library</library>
  <objects>
  </objects>
  <synonyms>
    <synonym>revdb_dbtype</synonym>
  </synonyms>
  <classification>
    <category>Database Operations</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <function tag="revDatabaseColumnTypes">revDatabaseColumnTypes Function</function>
    <function tag="revOpenDatabases">revOpenDatabases 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 type of database associated with a connection.</summary>
  <examples>
    <example>if revDatabaseType(1) is not "odbc" then</p><p>  checkLicense</p><p>end if</example>
    <example>if revDatabaseType(the currentDB of group "Display") is "Valentina" then </p><p>  sendValQuery </p><p>else</p><p>  sendGenericQuery</p><p>end if</example>
  </examples>
  <description>
    <p>Use the <b>revDatabaseType</b> <control_st tag="function">function</control_st> to send different queries or perform different operations depending on what kind of database is being used.</p><p/><p><b>Parameters:</b></p><p>The <i>databaseID</i> is the number <glossary tag="return">returned</glossary> by the <function tag="revOpenDatabase">revOpenDatabase</function> <control_st tag="function">function</control_st> when the <glossary tag="database">database</glossary> was opened.</p><p/><p><b>Value:</b></p><p>The <b>revDatabaseType</b> <control_st tag="function">function</control_st> returns a string containing up to two items (separated by a comma)</p><p/><p>Item 1 of the string is one of the following values: "MySQL", "ODBC", "Oracle", "PostgresSQL", "SQLite", "Valentina".</p><p/><p>Item 2 of the string is empty for all database types except ODBC. If the database type is ODBC then item 2 of the string contains the name of the database system being accessed by the ODBC driver. </p><p/><p><b>Comments:</b></p><p>You can use the <b>revDatabaseType</b> <control_st tag="function">function</control_st> to distinguish between different <glossary tag="database">database</glossary> types. For example, you may need to frame a <glossary tag="SQL query">SQL query</glossary> differently depending on what type of <glossary tag="database">database</glossary> you are communicating with.</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revDatabaseType</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>revDatabaseType</b> synonym was added in version 2.0.</p>
  </description>
</doc>