sourcetip

Google Apps 스크립트 쿼리를 Maria에게 보냅니다.DB

fileupload 2023. 10. 30. 21:12
반응형

Google Apps 스크립트 쿼리를 Maria에게 보냅니다.DB

최근 새로운 서버로 데이터를 옮겼습니다. 그러나 새로운 서버는 MariaDB를 사용하고 있습니다.

우리는 스프레드시트용 Google Apps Script에서 많은 쿼리와 계산을 수행합니다.서버 전환 이후 스크립트는 다음 오류를 반환합니다.

알 수 없는 시스템 변수 'OPTION'(21행, 파일 ")

21행은 다음 스크립트 내부의 쿼리를 나타냅니다.

function mysql_invoice() {

// Replace the variables in this block with real values.
var address = 'xxx';
var user = 'xxx';
var userPwd = 'xxx';
var db = 'xxx';

var dbUrl = 'jdbc:mysql://' + address + '/' + db;

// Read up to 100000 rows of data from the table and log them.

     var conn = Jdbc.getConnection(dbUrl, user, userPwd); 
      var stmt = conn.createStatement();


  // Call SO DATA 
      stmt.setMaxRows(10000);
      var start = new Date();

      var rs = stmt.executeQuery("select * from sales_flat_invoice");

무슨 생각 있어요?

당신이 setMaxRows를 사용한 방식이 문제라고 생각합니다.

제한을 설정하는 방법을 변경하면 작동합니다.

  // Call SO DATA 
  //      stmt.setMaxRows(10000);
  var start = new Date();

  var rs = stmt.executeQuery("select * from sales_flat_invoice limit 10000");

이렇게 하면 문제가 해결됩니다.이것은 확실히 당신의 MariaDB 버전과 jdbc 커넥터 버전의 미스매치에서 비롯됩니다.

건배.

언급URL : https://stackoverflow.com/questions/33810115/google-apps-script-query-to-mariadb

반응형