I have the following row in the table
TEMP_ID HTML_LABEL HTML_NAME OPTIONS_TYPE OPTION_VALUES HTML_CODE
----------------------------------------------------------------------------------------------
2 RULE_NO : RULE_NO_7_32 D SELECT DRV_COLUMN FROM FRD_DATA <reconTags:renderSelect></reconTags:renderSelect>
I want an oracle sql query that gives the output like this
TEMP_ID HTML_LABEL HTML_NAME OPTIONS_TYPE OPTION_VALUES HTML_CODE
----------------------------------------------------------------------------
2 RULE_NO : RULE_NO_7_32 D 1,2,3,4 <reconTags:renderSelect></reconTags:renderSelect>
I want the result of the query stored in the option_values field to be displayed as the value of the option_values field. (Possibly comma-separated concatenated values, where the query would return multiple rows.)
Create a function that takes your sql column as a parameter, and loops through each record building up a string of values then return the result, the usage would be
SELECT col1, your_function(col2) from your tableHere’s some pointers on dynamic SQL: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm
I guess it will be something like this: