postgresql - 如何使用 postgresql 为以下输入格式在存储过程中插入/更新多列
问题描述
{
"customer_id": 1000,
"customer_gst_no": "sfdsfds23232",
"customer_name": "abi",
"status": true,
"created_by": 1008,
"created_on": "1961-06-16",
"modified_by": 1008,
"modified_on": "1961-06-16",
"tbl_address_info": [
{
"customer_id": 1000,
"customer_address_id": 2000,
"customer_address": 1000,
"customer_city": "Tirunelveli",
"customer_pincode": "628777",
"customer_state": "Tamil Nadu",
"state_id": 1,
"status": true,
"is_default": true,
"created_by": 10000,
"created_on": "1961-06-16",
"modified_by": 20000,
"modified_on": "1961-06-16",
"customer_country": "India"
}
],
"tbl_product_info": [
{
"customer_id": 1000,
"customer_product_id": 3000,
"product_code": 1,
"product_name": "product1",
"product_status": "1",
"product_id": 1,
"created_by": 10000,
"created_on": "1961-06-16 00:00:00",
"modified_by": 20000,
"modified_on": "1961-06-16 00:00:00"
},
{
"customer_id": 1000,
"customer_product_id": 3001,
"product_code": 2,
"product_name": "product2",
"product_status": "1",
"product_id": 2,
"created_by": 10000,
"created_on": "1961-06-16 00:00:00",
"modified_by": 20000,
"modified_on": "1961-06-16 00:00:00"
}
]
}
这是我拥有的数据格式。如何传递这整个数据在多个表中插入值tbl_address_info
和tbl_product_info
?另外,将整个数据读入过程的数据类型是什么?
解决方案
推荐阅读
- linux - 什么是韦兰的“损坏请求”?
- angular - Angular 反应式表单,基于另一个表单上的 FormControl 验证一个表单
- angular - 使用 NgbModal 服务时如何测试模态内容
- python-3.x - 如何在 Python 中打印排序列表中的前 5 个项目
- webpack-4 - 如何通过 webpack 4 中的 mini-css-extract-plugin 正确处理 css 文件?
- php - 简单的正则表达式匹配在线调试器,但在 PHP 7.3 运行时不匹配
- javascript - 不能在复选框上输入 addEventListener?
- regex - 用于在文件中的每一行(不包含句号)的末尾添加句号的 Shell 脚本
- javascript - 如何循环具有多个选择的表单,以生成多个表单?
- node.js - 尝试将文件加载到服务器时无法 POST /upload。穆尔特