简体   繁体   English

DART SQL 如何从 SQL 查询结果中读取多行值(多列)

[英]DART SQL How do I read multiple row values (with multiple columns) from SQL query results in Dart?

Right now i am able to read data from the column in the single returned row ad below现在我可以从下面的单个返回行广告中的列中读取数据

    var resultsDoc = await conn
      .query('select fNAME, SPECIALITY, CATENAME from doctor where id = ?', [5]);
  for (var rowDoc in resultsDoc) {    
      ffname = rowDoc[0];      //reading value at column 1
      sspeciality = rowDoc[1];         //reading value at column 2
      ccategory = rowDoc[2];    //reading value at column 3
  }

what if i wanted to return the entire table as below enter image description here如果我想如下返回整个表格怎么办 在此处输入图像描述

Team, assist on how to read those values.团队,协助如何阅读这些价值观。

Thank You谢谢你

You were close!你很亲近!

for (var rowDoc in resultsDoc) {
  print(rowDoc.join('\t'));    
}

Or did you want to transpose the list of lists, so that you'd have 3 lists, one for each column?或者您是否想转置列表列表,以便您有 3 个列表,每列一个?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM