| | 1 | = SQL Constants = |
|---|
| | 2 | |
|---|
| | 3 | == Description == |
|---|
| | 4 | |
|---|
| | 5 | This plugin adds a new administration control panel that can be used to manage constants (key/value pairs) stored in the database. These can then be used in report queries. |
|---|
| | 6 | |
|---|
| | 7 | == Bugs/Feature Requests == |
|---|
| | 8 | |
|---|
| | 9 | Existing bugs and feature requests for SqlConstantsPlugin are |
|---|
| | 10 | [report:9?COMPONENT=SqlConstantsPlugin here]. |
|---|
| | 11 | |
|---|
| | 12 | If you have any issues, create a |
|---|
| | 13 | [http://trac-hacks.org/newticket?component=SqlConstantsPlugin&owner=optilude new ticket]. |
|---|
| | 14 | |
|---|
| | 15 | == Download == |
|---|
| | 16 | |
|---|
| | 17 | Download the zipped source from [download:sqlconstantsplugin here]. |
|---|
| | 18 | |
|---|
| | 19 | == Source == |
|---|
| | 20 | |
|---|
| | 21 | You can check out SqlConstantsPlugin from [http://trac-hacks.org/svn/sqlconstantsplugin here] using Subversion, or [source:sqlconstantsplugin browse the source] with Trac. |
|---|
| | 22 | |
|---|
| | 23 | == Example == |
|---|
| | 24 | |
|---|
| | 25 | Simply install the plugin as normal, and add a table like this to the database: |
|---|
| | 26 | |
|---|
| | 27 | {{{ |
|---|
| | 28 | CREATE TABLE `constants` ( |
|---|
| | 29 | `constant` varchar(255) NOT NULL, |
|---|
| | 30 | `stringval` varchar(255) DEFAULT NULL, |
|---|
| | 31 | `intval` int(11) DEFAULT NULL, |
|---|
| | 32 | `floatval` float DEFAULT NULL, |
|---|
| | 33 | PRIMARY KEY (`constant`) |
|---|
| | 34 | ); |
|---|
| | 35 | }}} |
|---|
| | 36 | |
|---|
| | 37 | You can then use this in report queries. The stringval column will always be stored. intval and floatval will contain the int/float equivalent if possible (i.e. the input could be cast to an int). |
|---|
| | 38 | |
|---|
| | 39 | Visit the administration panel to update constants. |
|---|
| | 40 | |
|---|
| | 41 | == Recent Changes == |
|---|
| | 42 | |
|---|
| | 43 | [[ChangeLog(sqlconstantsplugin, 3)]] |
|---|
| | 44 | |
|---|
| | 45 | == Author/Contributors == |
|---|
| | 46 | |
|---|
| | 47 | '''Author:''' [wiki:optilude] [[BR]] |
|---|
| | 48 | '''Contributors:''' |