API更新 - http://googleappsdeveloper.blogspot.sg/2013/11/code-updates-required-for-apps-script.html後,我在代碼中執行了更新。例外:訪問未配置 - API更新後使用Google Apps腳本的BigQuery
但我拋出一個異常:異常:訪問未配置
我授權的應用程序腳本使用的BigQuery和腳本API更新之前行之有效
var projectNumber='XXXXXXX';
var sql = 'a sql query';
var export_table = 'export_table';
var queryResults;
var j = BigQuery.newJob();
jr = BigQuery.newJobReference();
jr.setProjectId(projectNumber);
j.setJobReference(jr);
jc = BigQuery.newJobConfiguration();
jcq = BigQuery.newJobConfigurationQuery();
jcq.setQuery(sql);
t = BigQuery.newTableReference();
t.setDatasetId("export");
t.setTableId(export_table);
t.setProjectId(projectNumber);
jcq.setDestinationTable(t);
jcq.setWriteDisposition("WRITE_TRUNCATE");
jc.setQuery(jcq);
j.setConfiguration(jc);
try {
jobs = BigQuery.Jobs;
var resource = {
query: j,
timeoutMs: 1000
};
BigQuery.Jobs.query(resource,projectNumber);
} catch (err) {
Logger.log(err);
return;
}
感謝您的幫助。