# Source for file Informix.php

Documentation is available at Informix.php

1. <?php
2. /*
3. * $Id: Informix.php 1080 2007-02-10 18:17:08Z romanb $
4. *
5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16. *
17. * This software consists of voluntary contributions made by many individuals
18. * and is licensed under the LGPL. For more information, see
19. * <http://www.phpdoctrine.com>.
20. */
21. Doctrine::autoload('Doctrine_Import');
22. /**
23. * @package Doctrine
24. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
25. * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
26. * @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
27. * @version $Revision: 1080 $
28. * @category Object Relational Mapping
29. * @link www.phpdoctrine.com
30. * @since 1.0
31. */
32. class Doctrine_Import_Informix extends Doctrine_Import
33. {
34. protected $sql = array(
35. 'listTables' => "SELECT tabname,tabtype FROM systables WHERE tabtype IN ('T','V') AND owner != 'informix'",
36. 'listColumns' => "SELECT c.colname, c.coltype, c.collength, d.default, c.colno
37. FROM syscolumns c, systables t,outer sysdefaults d
38. WHERE c.tabid = t.tabid AND d.tabid = t.tabid AND d.colno = c.colno
39. AND tabname='%s' ORDER BY c.colno",
40. 'listPk' => "SELECT part1, part2, part3, part4, part5, part6, part7, part8 FROM
41. systables t, sysconstraints s, sysindexes i WHERE t.tabname='%s'
42. AND s.tabid=t.tabid AND s.constrtype='P'
43. AND i.idxname=s.idxname",
44. 'listForeignKeys' => "SELECT tr.tabname,updrule,delrule,
45. i.part1 o1,i2.part1 d1,i.part2 o2,i2.part2 d2,i.part3 o3,i2.part3 d3,i.part4 o4,i2.part4 d4,
46. i.part5 o5,i2.part5 d5,i.part6 o6,i2.part6 d6,i.part7 o7,i2.part7 d7,i.part8 o8,i2.part8 d8
47. from systables t,sysconstraints s,sysindexes i,
48. sysreferences r,systables tr,sysconstraints s2,sysindexes i2
49. where t.tabname='%s'
50. and s.tabid=t.tabid and s.constrtype='R' and r.constrid=s.constrid
51. and i.idxname=s.idxname and tr.tabid=r.ptabid
52. and s2.constrid=r.primary and i2.idxname=s2.idxname",
53. );
55. }