I got a json variable in which i got all my data. I'd like to take a specific key and its value to insert it in a specific column of my table.
Here is an example:
{
'Code bati': 'Pas',
Etage: '0',
Zone: 'FST',
'Pièce': '000',
'Priorité': 5,
'Désignation': 'Salle de cours',
'Type d’installation': '',
'Date de mise en service': '',
"Date d'installation": '',
Maintenance: '',
'Entreprise ayant le contrat de maintenan': '',
'Date de visite': 44525,
Marque: 'Epson',
'Modèle': 'EB-1980WU',
'N° série': 'V5YF630231L',
'Heure Lampe': 1796,
Position: 'centré',
HDMI: 'oui',
VGA: 'oui',
Video: 'non',
Automate: 'MLC ???',
Liaison: 'RS232',
'Type écran': 'manuel',
'Cage sécurité': 'oui',
'Statut HDMI': 'à tester',
'Statut VGA': 'à tester'
},
Here is my array, i'd like to take for example the key 'Zone' and its attribute 'FST' to insert them in a specific table of my postgres database. Do you have a solution for me ?
UPDATE your_target_table SET your_taget_column = your_json_data->>'Zone' WHERE your_condition_to select_the_row_to_update