Executing StoredProcedure with output parameter return only 10 characteres

Trying to execute a simple stored which has output parameter.

===========================================================

ALTER PROCEDURE [dbo].[TestOutput](@Data nvarchar(50) output)
AS
begin
select @Data = '123456789012345'
end

============================================================

SQL output:

While trying to execute this in outsystem it return back only 10 characters back


SyntaxEditor Code Snippet

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

exec [dbo].[testoutput] @Data output
select @Data



Below is the structure output I am using which I also tried setting the length of the output attribute

Any Idea?




Hi Aneesh,

Did you see this topic about stored procedures?

Kilian Hekhuis wrote:

Hi Aneesh,

Did you see this topic about stored procedures?

Hi Kilian, 

Appreciate your reply. I have gone through the topic mentioned, but couldn't find relevant to what I am looking for. 


Hi,

Can you fill in the default value of the returnOutput  attribute to the maximum characters (50 in your case) and try again please. (this can be a workaround, possibly)

on that note, it is a bug and you should report it as such.


J. wrote:

Hi,

Can you fill in the default value of the returnOutput  attribute to the maximum characters (50 in your case) and try again please. (this can be a workaround, possibly)

on that note, it is a bug and you should report it as such.


Hi J.

Appreciate your reply. 

I already tried removing the default value but same issue. I don't find an option to set maximum characters on a text attribute of a structure. I have already reported, however was checking if there is any workaround someone found before. 


Hi Aneesh,

What J means, is that in the last image, where you set the length of the Output Attribute to 50, you should also put a "Default Vaklue" in there that is actually 50 characters (something like "12345678901234567890123456789012345678901234567890"), the try again.

Kilian Hekhuis wrote:

Hi Aneesh,

What J means, is that in the last image, where you set the length of the Output Attribute to 50, you should also put a "Default Vaklue" in there that is actually 50 characters (something like "12345678901234567890123456789012345678901234567890"), the try again.

Hi Kilian, 

I tried this, but the issue persist.


Too bad! Hopefully OutSystems Support has a solution soon.

Solution

Hi aneesh,


Joost pointed me to your question. I had to solve the same issue couple of months ago. After contacting support we figured out it was due to optimalisations. They will by default declare the output variable to a lower size.


The workaround is to declare your output parameter by using a double @ sign. Look at my example:


Hope it helps you out


Regards

Jeroen 

Solution

Cool Data Mover wrote:

Hi aneesh,


Joost pointed me to your question. I had to solve the same issue couple of months ago. After contacting support we figured out it was due to optimalisations. They will by default declare the output variable to a lower size.


The workaround is to declare your output parameter by using a double @ sign. Look at my example:


Hope it helps you out


Regards

Jeroen 

Hi Jeroen,

Appreciate your reply. That worked... Cheers.. 


Thanks Jeroen!

Your welcome, good to hear it helped!