RequestError: Must declare the scalar variable [MSSQL-PLUS]

Hello,

In sandbox env. suddenly im facing MSSQL-PLUS node notifcation(error):
"RequestError: Must declare the scalar variable "@Company"."
MSSQL node:

Strange thing, that is was not changed/modified.

Can somebody help me out?

Did you pass the value in your message payload? Maybe it's not set or undefined so the MSSQL lib would complain it's missing.

Hi Kuema,

Its not long flow


As i mentioned before, it wasn't changed! Here s screenshot from split to SQL

Error in debug:
image

What's the output of the debug node attached to your function node? Does the payload contain Company? I'd check that first.

Yes, name is hidden, but it looks like this:
image

So, i remembered something!
I restarted virtual machine (centos7) , now im looking at palletes and i can see warning sign, I guess i need to uninstall one pallete!
image

all are "in use"
i can just npm uninstall node-red-contrib-mssql ?

Ah! That's it! Good spot! Those two nodes use the same id.

You can only install one of them.

Yes... just uninstall the other one and you'll be fine. You have to restart Node-RED after that.

1 Like

Ehhh, did that...
Still getting same error... RequestError: Must declare the scalar variable "@Company".

Which MSSQL node did you use first?

The MSSQL-PLUS node has a lot of settings regarding parameters.

Anyway, I would check the node's settings, as they might not be compatible with each other if you used the other SQL node before.

I don't have a MSSQL setup at home, so I can't check right now.

1 Like

I just checked anyway... :nerd_face:

You have to explicitly set where your parameters come from. So try to set "Parameters" to msg.payload. I think it uses msg.queryParams by default.

1 Like

Ehhh, still getting same error even configuring as you recommended.

Kuema, you was right!!! MSSQL-PLUS parameters are wayy different!
Now im re-doing everything and I got first MSSQL column!

Thanks for support @kuema , and have a nice life!

BTW @Steve-Mcl, still using your solution for my problem, it works excellent!

1 Like

No problem. There weren't many options left other than configuration issues due to the switch between two different nodes.

Glad I could help and have fun coding! :nerd_face:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.