jordan.c
(Jordan Chang)
March 5, 2024, 2:33am
1
Hi,
I’m trying to pass 17 parameters to the Store Procedure but i’m getting the following error:
My query is as such:
“EXEC AutoMatch.sp_batchInsert @param1 = '”+param1+“', @param12= '”+param2+“', @param3= '”+param13+
“', @param4= '”+param4+“', @param5= '”+param5+“', @param6= '”+param6+“', @param7= '”+param7+
“', @param8= '”+param8+“', @param9= '”+param9+“', @param10= '”+param10+“', @param11= '”+param11+
“', @param12= '”+param12+“', @param13= '”+param13+“', @param14= '”+param14+“', @param15= '”+param15+
“', @param16= '”+param16+“', @param17= '”+param17+“'”
Anil_G
(Anil Gorthi)
March 5, 2024, 3:04am
2
@jordan.c
Instead of passing as parameters try to add the extra ones as variables directly in the statement…or add all as variables both should work
Cheers
jordan.c
(Jordan Chang)
March 5, 2024, 3:18am
3
Hi @Anil_G ,
I did pass them as variables if you look at the statement I pasted. If I removed the EndDate variable then it will work otherwise it will generate the said error message.
Anil_G
(Anil Gorthi)
March 5, 2024, 3:22am
4
@jordan.c
One work around int hat case would be …if there are any string parameters combine them with delimitter and then inside the storedproc split and use it
Cheers
1 Like
jordan.c
(Jordan Chang)
March 5, 2024, 4:01am
5
In case this helps others as well, I’ve used the following formula as per your guide:
combineDates = String.Join(“-”, startDate, endDate)
Then within the SQL Query, i use:
combineDates.Split(“-”)(0) for the first string
combineDates.Split(“-”)(1) for the second string
Thanks @Anil_G , much appreciated.
1 Like
system
(system)
Closed
March 8, 2024, 4:01am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.