Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call procedure #17

Open
GrigoriyMo opened this issue Jan 5, 2020 · 1 comment
Open

call procedure #17

GrigoriyMo opened this issue Jan 5, 2020 · 1 comment

Comments

@GrigoriyMo
Copy link

Can You, please explain how to call the proc properly using your module? Thank You in advance!
For exmple i try to run the next:
db.call(procs.registration, "hello");
and have the next feedback from node:


TypeError: Expected args to be strings
    at Connection.call (/aut/ufo/node_modules/sync-mysql/lib/index.js:43:15)
    at Object.<anonymous> (/aut/ufo/lib/test.js:23:4)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
@charmingny
Copy link

example from my project

this.m_connection = new MySql({
host: 'localhost',
user: 'root',
database: 'test',
password: ''
});

const sql:string = "call p_update_winlose(" +
"0," +
"'"+ Playerstr + "'," +
"'"+ CoinStr + "'," +
"@out_result," +
"@out_ids," +
"@out_coins" +
")";

const result = this.m_connection.query(sql);
const query = this.m_connection.query("SELECT @out_ids AS pids, @out_coins AS coins");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants