我正在尝试将json文件的每一行传递给SQL Select语句。如何以迭代方式使用python传递值
Json文件包含以下几行:
{"row_id":"1","a":"600","b":"hello","date":"2017-07-01","enabled":"TRUE","id":"234"}
{"row_id":"2","a":"650","b":"world","date":"2018-08-02","enabled":"FALSE","id":"456"}
{"row_id":"3","a":"700","b":"world","date":"2019-02-10","enabled":"FALSE","id":"789"}
我试图将每行值传递给sql语句。 例如:
当row_id = 1时,则应传递相应行的值
Select * from xyz where a='600' and b='hello' and date ='2017-07-01';
当row_id = 2时,则应传递相应行的值
Select * from xyz where a='650' and b='world' and date ='2018-08-02';
当row_id = 2时,则应传递相应行的值
Select * from xyz where a='700' and b='world' and date ='2019-02-10';
谢谢
答案 0 :(得分:1)
假设您一次传递一个JSON对象
示例
BitmapDescriptor get deliveryIcon {
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
if (isIOS)
return BitmapDescriptor.fromAsset('assets/icons/orange_pin.png');
else
return BitmapDescriptor.fromAsset(
'assets/icons/3.0x/orange_pin.png');
}