I have an SQL table column (BINARYTEXT) populated with a CLOB. Within this CLOB is a number of attributes, e.g.,
CE.EffDate="20140106";
CE.CCY="EUR";
CE.TransactionType="STANDARDEUROPEAN";
CE.CAL="LON";
I need to extract only the value of the CE.TransactionType attribute contained between the double quotes so 'STANDARDEUROPEAN'. Note that the CLOB does not contain XML and only contains attributes as above with no start or end tags.
I have worked out how to do this using the REGEXP_SUBSTR function when I specify the string in the command:
select REGEXP_SUBSTR('CE.TransactionType="STANDARDEUROPEAN"', '="[^"]+') transtype
from DUAL
which returns: ="STANDARDEUROPEAN
I am unable to manipulate this into using the CLOB as the string. This does not work:
select REGEXP_SUBSTR(BINARYTEXT,'CE.TransactionType="STANDARDEUROPEAN"', '="[^"]+') transtype
from DUAL
This comes up with a blank integer error, although I am unsure why it is expecting an integer.