cancel
Showing results for 
Search instead for 
Did you mean: 

How to call HANA SQLScript procedures

Former Member
0 Kudos

Hello,

    I am currently learning SAP HANA. I have a problem creating my own procedure. I want to create a procedure that generates a unique random string, but until there, I started with something simple (and stupid). I have a database called ETD. Here is my code:

CREATE PROCEDURE GEN_STRING(IN INVAL VARCHAR(30), OUT RETURNVAL VARCHAR(32))

LANGUAGE SQLSCRIPT

   AS

   INVAL VARCHAR(30);

BEGIN

RETURNVAL := INVAL + 'aa';

END;

This procedure just takes a parameter and appends 'aa' to it. But when I call the procedure in SQLConsole:

CALL "ETD"."GEN_STRING"(INVAL => 'HAHAHA',RETURNVAL => ? );

The returned value is '?'. NormallyI know from the OpenSAP course that for the output parameters, we have to put '?'. What am I doing wrong? Thank you in advance,

Andrei

Message was edited by: Tom Flanagan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Andrei,

Using "+" is not going to concatenate the strings in HANA, you have to use the "CONCAT" function.

Regards,

Krishna

Answers (0)