Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.