Skip to Content
avatar image
Former Member

How to call HANA SQLScript procedures

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 23, 2014 at 01:58 PM

    Hello Andrei,

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

    Regards,

    Krishna

    Add comment
    10|10000 characters needed characters exceeded