I have a column that stores XML as CLOB data, and in these XMLs I have an ID information. At first, I extracted the ID information using an REGEX expression, e.g.:

```sql
SELECT
    regexp_substr(XML_CONTENT, '(<identifier>)(.*)(<\/identifier>)', 1, 1, 'c', 2) as ID
FROM XML_TABLE w 

```

Then, this query results a table with one CLOB column containing the ID information. E.g.:

|ID (CLOB)|
-----------

|123456|
|456789|

Now that I have this information, I want to join it with another table referencia an integer PK column, and to do this I need to cast the CLOB ID to INTEGER ID. How can I do that?

I'm doing this to find differences between a DEV and PROD databases, and in this environemtn DB2 versions are different, so I need this query to compatible in DB2 9.5 and DB2 11.5.