I have data stored in following format in one of my columns;
[
{
"arrival_date": "2022-02-15T08:00:00.000Z",
"cargo_available_timestamp": "2022-02-16T13:00:00.000Z",
"cargo_type": "unable_to_provide",
"carton_count": null,
"lfd": "2022-02-17T08:00:00.000Z"
},
{
"arrival_date": "2022-02-16T08:00:00.000Z",
"flight_status": "in_transit",
"flight_status_other": null
}
]
I am trying to extract he value for lfd as shown in the data, using following code;
select col1,
json_extract_path_text(get(col1,0),'lfd') as value
from table
But it seems the get() command is not getting an array. And I am getting following error:
SQL compilation error: error line 4 at position 20 Invalid argument types for
function 'GET': (VARCHAR(16777216), NUMBER(1,0))
When I checked the data type for col1 it is varchar. May I know how can I parse this varchar to extract value for lfd. thanx