I am trying to insert into a temp oracle table using select which gets data from a blob field but I am getting the error -"missing SELECT keyword" .
How do we store temp result in oracle when we are doing this sort of operation ( fetching data from fields and trying to load them in a separate new table on the fly.?
with cte as(
select user_id,utl_raw.cast_to_varchar2(dbms_lob.substr(PREFERENCES)) as my_blob from USER
)
create table new_table as
SELECT user_id,EXTRACTvalue(xmltype(e.my_blob),'/preferences/locale') as locale
FROM cte e
----------------------------------------------------------------------------------
Blob data - value- which is
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <preferences> <timezone>America/New_York</timezone> <displayscheduleinusertimezone>Y</displayscheduleinusertimezone> <dateformat>M/d/yyyy</dateformat> <timeformat>hh:mm aaa</timeformat> <longformat>Long_01</longformat> <doubleformat>Double_01</doubleformat> <percentformat>Percentage_01</percentformat> <currencyformat>Currency_01</currencyformat> </preferences>