Let SQLDocument display your RDBMS-Data
Get and install the software
To let SQLDocument access you data in your RDBMS you need to configure and install a "ZopeDatabase Connection".
In this example we will use a MySQL Database with ZMySQLDatabase Adapter.
(you can find it here http://sourceforge.net/project/showfiles.php?group_id=22307.)
If you need further help for installing and configuring your Database Adapter please look at the Relational Database Chapter in the Zope Book. http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx#1-6
If you have your Zope Database Adapter running you have to install the SQLDocument.
Just put the package in your Products direcotry. You can find SQLDocument here http://www.plone.org/products/sqldocument. Or checkout form svn into your Products dir
# svn co https://svn.plone.org/svn/collective/SQLDocument/trunk SQLDocument
Configuring (the ZMI-Part)
Add and configure your DatabaseConection through zope ZMI

For our example we use the Table Adresse from the Database RedENet.
The table looks like these little example:
| adresse_id | P_KNR | P_STRASSE | P_PLZ | P_ORT | P_NAME1 | P_NAME2 | P_NAME3 | P_HAUSNR | P_BV |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 32 | Kaiserstr | 90763 | Fürth | Novareto | GMBH | CoKG | 16 | 4 |
| 2 | 43 | Schwabacherstr | 90764 | Fürth | IM | Immobilien | | 22 | 5 |
Configuring (the Plone Part)
First install SQLDocument in the Quickinstaller.
If you get no errors during install. You should have SQLDocument as a new type to add in your Plone.
Make the first qury with SQLDocument
default - here you can edit gernaral things for SQLDocument- The first step is add an SQLDocument anywhere in your portal.
- Now give your new SQLDocument a nice Title and Description.
- Now choose your Database-Connection ( you should see your DatabaseConnection )
- Add your sql-statement in the SQL field
- You can ignore the Pre Input Method (for now)
- Click next

SQL-Test - your sqlstatement is tested here
- check your sqlstatement.
- if you think everything is valid press next.
- if you see an error go back and edit your sqlstatement.

Look at the missing "r" in from
Note: You can not reach the next form until your sqlstatement is valid.
If you haven´t any error left change to the next form.
Settings - here you can configure "displaying" options

Now press save and you will see your results.


