0
var client = new require("mysql-pool").MySQLPool({...});

client.query( 
   "SET @counter := 0, @type := 'asd'; select @counter, @type"   ,

    function (error, result, fields) {
       if (error) {
           throw error;
       }else{
          cb(result, fields);
       }
    });

( 

query work just fine in workbench or dbForge, and mysql-pool also works, but only without @variable_name )

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126

1 Answers1

0

Maybe like that ?

"SELECT @counter := 0, @type := 'asd'"

But TYPE could be RESERVED name, so consider to use sth. else ie. ENTITY_TYPE

jaczes
  • 1,366
  • 2
  • 8
  • 16