I keep getting this error
"ReferenceError: "BigQuery" is not defined. (line 19, file "Code")"
when trying to this script in apps script
function saveQueryToTable() {
var projectId = 'fiery-cabinet-****';
var datasetId = '11234***1';
var tableId = 'TEST4';
var job = {
configuration: {
query: {
query: 'SELECT *' +
'FROM Test2;',
destinationTable: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
}
}
}
};
var queryResults = BigQuery.Jobs.insert(job, projectId);
Logger.log(queryResults.status);
}
Could anyone let me know where I'm going wrong?
Thanks