sachanrahul / common-schema

Automatically exported from code.google.com/p/common-schema
0 stars 0 forks source link

enhance _wrap_select_list_columns to "pad" up to n columns #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to be able to call upon _wrap_select_list_columns with an 
additional param, e.g.
CALL _wrap_select_list_columns("SELECT something FROM somewhere", 9)

such that if there are less than n columns to be wrapped, the procedure will 
inject columns so that the query does return n columns.
Injected columns will continue the numbering scheme. If wrapped qurry returns 
with col1, col2, col3 without injection, then injection pads col4, col5, col6, 
.. coln

The data itself can be (and should be) NULLs; so the wrapped query would look 
like:

SELECT (SELECT something) AS col1, NULL AS col2, NULL AS col3, ... FROM 
somewhere.

This is required for continued work on foreach()

Original issue reported on code.google.com by shlomi.n...@gmail.com on 14 Sep 2011 at 5:22

GoogleCodeExporter commented 8 years ago
Ok, I'll give it a crack this evening.

Original comment by roland.bouman on 14 Sep 2011 at 7:51

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/common-schema/source/detail?r=84 should fix this issue.

Original comment by roland.bouman on 15 Sep 2011 at 10:25