ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:setactualtype

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
v5:dictionary:setactualtype [2017/05/14 00:22] mnewnhamv5:dictionary:setactualtype [2017/05/15 16:46] – [Usage] adjust formatting, fix typo dregad
Line 16: Line 16:
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-The method ''setActualType()'' either modifies the database specific data type for a given [[v5:dictionary:metatype]], or provides the ability to create a new one. The returned values indicates the success of the operation. +The method ''setActualType()'' either modifies the database specific data type for a given [[v5:dictionary:metatype]], or provides the ability to create a new one. The returned value indicates the success of the operation. 
  
 If the method is used to create a new ''actualType'', then the optional bool $newType must be set. If the method is used to create a new ''actualType'', then the optional bool $newType must be set.
Line 22: Line 22:
 A connection to a data dictionary object is required, but a database connection is not. A connection to a data dictionary object is required, but a database connection is not.
 ===== Usage ==== ===== Usage ====
-In this example we want to change the behavior of the mssqlnative driver, so that instead of the default ''datetime'' type associated with the 'D' metatype, we want to use data dictionary functions to create a more portable 'date' type (available since SQL Server 2008).+In this example we want to change the behavior of the mssqlnative driver, so that instead of the default ''datetime'' type associated with the ''D'' metatype, we want to use data dictionary functions to create a more portable ''date'' type (available since SQL Server 2008).
 <code php> <code php>
 $db = newAdoConnection('mssqlnative'); $db = newAdoConnection('mssqlnative');
Line 29: Line 29:
 $dict->setActualType('D','DATE'); $dict->setActualType('D','DATE');
 </code> </code>
-In the second example, we will create a new actual types so that we can use the adodb dictionary function to create tables containing geospatial information.+In the second example, we will create a new actual types so that we can use the ADOdb dictionary function to create tables containing geospatial information.
  
 <code php> <code php>
-$db = newAdoConnection('mysql');+$db = newAdoConnection('mysqli');
 $dict = NewDataDictionary($db); $dict = NewDataDictionary($db);
  
Line 50: Line 50:
 Array Array
 ( (
- [0] => ALTER TABLE POSITION ADD GEODATA GEOMETERY+ [0] => ALTER TABLE POSITION ADD GEODATA GEOMETRY
  [1] => ALTER TABLE POSITION ADD POINTDATA POINT  [1] => ALTER TABLE POSITION ADD POINTDATA POINT
 ) )
v5/dictionary/setactualtype.txt · Last modified: 2017/07/22 18:39 by mnewnham