cancel
Showing results for 
Search instead for 
Did you mean: 

Hana procedure syntax

pm_witmond
Participant
0 Kudos
70

Hello,

I'm having problems with a simple query in a procedure.

Can anyone please help me ?

I'm trying to create a simple table filled with data

CREATE PROCEDURE pr01(IN CardCode NVARCHAR(20)) LANGUAGE SQLSCRIPT AS

BEGIN

     CREATE COLUMN TABLE TEMPTBL AS (SELECT "DocNum" FROM ORDR WHERE "CardCode" =:CardCode);

END

Thanks,

Paul

View Entire Topic
patrickbachmann
Active Contributor
0 Kudos

Try something like this;

CREATE PROCEDURE pr01(IN CardCode NVARCHAR(20))

LANGUAGE SQLSCRIPT

  SQL SECURITY DEFINER AS

BEGIN

     CREATE COLUMN TABLE TEMPTBL (DOCNUM NVARCHAR(20));

INSERT INTO TEMPTBL SELECT "DocNum" FROM ORDR WHERE CardCode = :CardCode;

END

-Patrick

pm_witmond
Participant
0 Kudos

Patrick,

Thanks !

It's working

Paul

patrickbachmann
Active Contributor
0 Kudos

Awesome, glad to help.