cancel
Showing results for 
Search instead for 
Did you mean: 

Can HANA stored procedures have a scalar output parameter?

Former Member
0 Kudos

Hello all,

Was just curious to know if I can take singular values as output from stored procedures instead of table types.

I know the graphical method of defining SPs won't allow it but is there a way to do it by way of SQL.. I did try and fail on that..

Would be good if you guys can confirm..

Also, if there is no way.. then if i want a reusable functionality should I create a function.. ?

Let me know.

Thanks,

Sammy

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Any thoughts?

former_member182302
Active Contributor
0 Kudos

It did worked. What are the errors you are facing?

Have a look on the sample below:


create procedure SAMPLE_TEST ( OUT OUTVAR INTEGER )

AS

BEGIN

SELECT YEAR(CURRENT_DATE) INTO OUTVAR FROM DUMMY;

END

CALL SAMPLE_TEST (?);

Regards,

Krishna Tangudu

Former Member
0 Kudos

Can it be any type which returns from the query? How can we solve such a problem?

  1. create procedure SAMPLE_TEST ( OUT OUTVAR (???)
  2. AS 
  3. BEGIN 
  4. SELECT X,Y,Z ....
  5. END

Edit: I mean I want to return table.

lbreddemann
Active Contributor
0 Kudos

Kemal,

please do read the SQLScript developer guide!

It explains the usage of table typed parameters quite well.

- Lars