[TYPO3-dev] Re: esp - some technical aspects

Elmar t3elmar at googlemail.com
Mon Apr 1 22:45:18 CEST 2013


Lot's of unit testing and reading of docs, to find out what is possible. For those who are interested:

> The good news
> ============
> 
> I just discovered, that stored procedures are more simple to apply then thought.
> It seems there is no reason to return the result as a temporary table. 
> The procedure can return a result like any call to SELECT.

1.) There are two options to return a multiline result from a stored procedure,
either directly or in a temporary table.

2.) To return it directly requires a *mysqli* connection, because it needs the multiresult feature.
So it's good news that we have a mysli connection by default with 6.1.

3.) Temporary tables are not really temporary (at least with 4.x) because of *mysql_pconnect*.
This requires a random part in the name, what would make writing stored procedures rather 
complicated.

4.) It's also not possible to create a temporary table from a call to a stored procedure,
that returns directly. That is an impartant differnce to a SELECT query. Something like this
is not possible: CREATE TEMPORARY TABLE mytable FROM CALL my_stored_procedure().

The bottomline is, that there is no easy and fast way to get the result into a temporary table,
that could be accessed by the TypoScript objects CONTENT or RECORDS.

My new approach
=============

Simplicity over speed

1.) Writing stored procedures should be easy. No temporary tables in the procedure.

2.) This requires the use of mysqli. For versions < 6.1 a dedicated mysqli connection
needs to be opened.

3.) Because of the lack of temporary tables neither CONTENT nor RECORDS can be applied.

4.) I provide two renderers as replacement tx_esp_SimpleRender and tx_esp_JoinRenderer. 

5.) The simple rendere is configured like CONTENT but accesses the result-link instead of a table.

Regards

Elmar




More information about the TYPO3-dev mailing list