Insert with Select

How can I insert values from a select when value is not an object.
I am trying to get a statement like the following to work:

insert into development (KEY id, VALUE docType, stadiumID, active, name, address, city, zip, country, capacity, geoLat, geoLong)
uuid() as id,
‘stadium’ as docType,
s.StadiumID stadiumID,
s.Active active,
s.Name name,
s.Address address,
s.City city,
s.State state,
s.Zip zip,
s.Country country,
s.Capacity capacity,
s.GeoLat geoLat,
s.GeoLong geoLong
from default as s
where s.docType=‘nba:stadium’

INSERT INTO  `development`  (KEY id, VALUE  doc)
SELECT uuid() AS id, {"docType":"stadium", "stadiumID": s.StadiumID, "active":s.Active, "name":s.Name, "address":s.Address , "city":s.City , "state":s.State , "zip":s.Zip , "country":s.Country , "capacity":s.Capacity , "geoLat": s.GeoLat , "geoLong":s.GeoLong } AS doc
FROM default AS s
WHERE s.docType="nba:stadium"
1 Like