SQL Language (MOSC)

MOSC Banner

How to load data in a table with JSON datatype column ?

edited Dec 1, 2015 1:59PM in SQL Language (MOSC) 4 commentsAnswered ✓

Hi

I would like to create the following table :

>>

CREATE TABLE met_p6_ref_pointb

(

  "ID" integer NOT NULL,

  type_prev integer NOT NULL,

  localisation integer NOT NULL,

  date_publi timestamp without time zone NOT NULL,

  data CLOB

  CONSTRAINT ensure_json CHECK (data IS JSON));

<<

and load the data

data sample :

867155,1,497,26/06/2013 18:00:00,000000,{"ID":867155,"valeur":4, "date_valid": "01/01/2015 01:00:00,000000"}

from the following tables :

>>

CREATE TABLE EIGJSON.MET_P6_POINT

(

  ID INTEGER,

  DATE_VALID TIMESTAMP(6) NOT NULL,

  VALEUR FLOAT(126)

)

data sample:

ID,DATE_VALID,VALEUR

867155,01/01/2015 01:00:00,000000,4

CREATE TABLE EIGJSON.MET_P6_REF

(

  ID INTEGER NOT NULL,

  TYPE_PREV INTEGER NOT NULL,

  LOCALISATION INTEGER NOT NULL,

  DATE_PUBLI TIMESTAMP(6) NOT NULL

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center