Error in calling SP

Error in calling SP

  

I am trying to call a SP from my outsystems with the following code. I ma getting exception and SP is getting failed. Can someone pleas help me.  The values as an input param i am passing correctly.


SyntaxEditor Code Snippet

/* %LogicalDatabase%=GetLogicalDatabase({cl_mngr}) */

execute procedure sp_clmngr_ins(@HCPId, @RecordNum, @PlacementType, @RecruiterUsername, '(4)', NULL, NULL )

Error that I am getting:


Error in advanced query SP_CLMNGR_INS in Webhook in Texting in TextingService (/* %LogicalDatabase%=GetLogicalDatabase({cl_mngr}) */    execute procedure  sp_clmngr_ins(@HCPId, @RecordNum, @PlacementType, @RecruiterUsername, '(4)', NULL, NULL )): Incorrect syntax near the keyword 'procedure'.
   at ssTextingService.CsRESTExpose.CsTexting.CsTextingControllerFlows.FuncFlowTextingActionWebhook.QuerySP_CLMNGR_INS(HeContext heContext, Int32 maxRecords, IterationMultiplicity multiplicity, Int64& outParamCount, Int32 qpinHCPId, Int64 qploRecordNum, Int32 qpinPlacementType, String qpstRecruiterUsername)
   at ssTextingService.CsRESTExpose.CsTexting.CsTextingControllerFlows.FlowTextingActionWebhook(HeContext heContext, Byte[] inParamTextUSRequest, STTextUsWebhookResponseStructureStructure& outParamWebhookResponse)
   at ssTextingService.CsRESTExpose.CsTexting.CsTextingController.FlowTextingActionWebhook(Byte[] auxinParamTextUSRequest)




Hi,

You have a syntax error in the call.

Please, refer to this topic to learn how to call SQL Server stored procedures: https://www.outsystems.com/forums/discussion/14867/how-to-execute-stored-procedures/

Cheers

Hi Tanuj,

You have two possible situations : 


1st -  The database where the Store Procedure is stored is an outSystems generated db

EXEC [usp_TestProc]

2nd -  The database is an external DB that you created and use integration studio to bring into OutSystems. 

/* %LogicalDatabase%=GetLogicalDatabase({Your Table name}) */

EXEC [usp_TestProc]


You can find more details on the following post: https://www.outsystems.com/forums/discussion/14867/how-to-execute-stored-procedures/

Hope this helps !


Romero wrote:

Hi Tanuj,

You have two possible situations : 


1st -  The database where the Store Procedure is stored is an outSystems generated db

EXEC [usp_TestProc]

2nd -  The database is an external DB that you created and use integration studio to bring into OutSystems. 

/* %LogicalDatabase%=GetLogicalDatabase({Your Table name}) */

EXEC [usp_TestProc]


You can find more details on the following post: https://www.outsystems.com/forums/discussion/14867/how-to-execute-stored-procedures/

Hope this helps !


Its a external DB that we have created.

So whats must be the syntax. I went to the aforesaid thread but does not understand completely.

So is this wrong ??

SyntaxEditor Code Snippet

/* %LogicalDatabase%=GetLogicalDatabase({cl_mngr}) */

execute procedure <SP name>


Eduardo Jauch wrote:

Hi,

You have a syntax error in the call.

Please, refer to this topic to learn how to call SQL Server stored procedures: https://www.outsystems.com/forums/discussion/14867/how-to-execute-stored-procedures/

Cheers

Can you please elaborate more . What is the error exactly.

I tried :

EXEC [Schema_Name].[Sp Name]
@necessary params


Hi Tanuj,

Your first syntax was wrong, as you saw in the link I provided. 

What's the error in the second trying?

Here is an example on how to call a SP using C# (Dot Net stack), that you can do in an extension.

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/RuntimePublic.Db_API/Call_a_Stored_Procedure

Cheers