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

MSSQL - Could not find stored procedure 'object Object' #1669

Closed
KromDaniel opened this Issue Sep 15, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@KromDaniel

KromDaniel commented Sep 15, 2016

Hey
NodeJS v6.4.0
knex 0.12.0
MSSQL (NPM) 3.3.0
Running the next code:

select()
 .from("dbo.brData as brd")
 .fullOuterJoin("dbo.phs as phs","brd.ph_id","phs.id")
 .fullOuterJoin("dbo.pat as pat","pat.path","phs.path")
 .where("tx_type","Small")
 .andWhere(function(){
     this.where("brd.e_id","someId")
      .orWhere("brd.t_id ","someId");
   }).then(resolve,reject);

Always returns the error:

Could not find stored procedure 'object Object'.

If I'm doing queryBuilder.toString() it returns good and valid query but queryBuilder.raw(query.toString) returns same error

Thanks

@cdmcnamara

This comment has been minimized.

cdmcnamara commented Sep 15, 2016

I was encountering this issue too, and it looks like the culprit is this change: 0b25f6b#diff-94c7d1519ac82e543cc9008e996e4c63L104.

When I revert those two lines on my test file, it appears to work again.

@cdmcnamara

This comment has been minimized.

cdmcnamara commented Sep 15, 2016

I'd like to make a pull request to fix it but I'm not entirely sure what the point of this block is as sql is originally a string, but then it looks like it's trying to make it an object that contains a sql field and the fields from obj.options using assign.

@tgriesser, could you shed some light?

@hitgeek

This comment has been minimized.

hitgeek commented Sep 16, 2016

having same issue.
simple select * query returns "Could not find stored procedure 'object Object'"in 0.12, but works in 0.11.

MSSQL Trace shows the query exec sp_executesql @statement=N'[object Object]'

@tgriesser tgriesser closed this in 29f5070 Sep 16, 2016

@tgriesser

This comment has been minimized.

Owner

tgriesser commented Sep 16, 2016

I think the commit I just added should fix it, will cut a release shortly

@KromDaniel

This comment has been minimized.

KromDaniel commented Sep 16, 2016

Thanks for the real quick solution!

tgriesser added a commit that referenced this issue Sep 16, 2016

Merge branch 'master' into refactor
* master:
  release 0.12.1
  Add DEBUG=knex:bindings for #1557
  Fix #1669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment