PDF (US Ltr) - 2.3Mb
PDF (A4) - 2.3Mb
在批次模式下執行 MySQL Shell 時,預設會使用 Tab 分隔格式來列印結果集,以便更好地進行自動分析。
若要在互動模式下執行時取得此輸出格式,請使用 --result-format=tabbed
命令列選項(或其別名 --tabbed
)啟動 MySQL Shell,或將 MySQL Shell 設定選項 resultFormat
設定為 tabbed
。
範例 5.2 Tab 分隔格式的輸出
MySQL localhost:33060+ ssl world_x JS > shell.options.set('resultFormat','tabbed')
MySQL localhost:33060+ ssl world_x JS > session.sql("select * from city where countrycode='AUT'")
ID Name CountryCode District Info
1523 Wien AUT Wien {"Population": 1608144}
1524 Graz AUT Steiermark {"Population": 240967}
1525 Linz AUT North Austria {"Population": 188022}
1526 Salzburg AUT Salzburg {"Population": 144247}
1527 Innsbruck AUT Tiroli {"Population": 111752}
1528 Klagenfurt AUT Kärnten {"Population": 91141}
6 rows in set (0.0041 sec)