Quantcast
Channel: SCN : All Content - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 3285

Use of Cursor in Procedure on Hana Trial Account

$
0
0

Hello Experts,

 

I want to know can we consume procedures with cursor on Hana trial Account. I have created one simple procedure with cursor as shown below.

I know the example shown can be done without cursors. Just wanted to try this piece of code.

 

 

CREATE PROCEDURE "NEO_<Schema>"."PROC_TEST3"

(OUT OUTPUT_TABLE "NEO_<Schema>"."TYP_TEST")

LANGUAGE SQLSCRIPT AS

BEGIN

DECLARE CURSOR CUR_C1 FOR

    SELECT FIELD1 AS NAME FROM "_SYS_BIC"."s00xxxxxxtrial.hana.demo.InformationView/CV_TEST";

 

CREATE LOCAL TEMPORARY TABLE "#OUTPUT_TABLE"(NAME VARCHAR(20));

FOR CUR_ROW1 AS CUR_C1 DO

    INSERT INTO "#OUTPUT_TABLE" VALUES (:CUR_ROW1.NAME);

END FOR;

OUTPUT_TABLE = SELECT NAME FROM "#OUTPUT_TABLE";

DROP TABLE "#OUTPUT_TABLE";

END

 

 

Above procedure is activated and running fine in sql console. But when I try to activate model_access.hdbrole file with the below entry it is giving error.

 

role s00xxxxxxtrial.hana.demo::model_access
{
  catalog schema "NEO_<Schema>":CREATE ANY, DROP, INDEX, SELECT, INSERT, UPDATE, DELETE ,EXECUTE;// SELECT, INSERT,DELETE, DROP, CREATE ANY, EXECUTE;
  catalog sql object "NEO_<Schema>"."PROC_TEST3":EXECUTE ;

}

 

 

Error while activating /s00xxxxxxtrial/hana/demo/model_access.hdbrole:

[s00xxxxxxtrial.hana.demo:model_access.hdbrole] insufficient privilege: Not authorized to grant the privilege on the procedure: line 1 col 51 (at pos 50) at ptime/query/checker/check_priv.cc:1432


 

Thanks & Regards,

Deepak.


Viewing all articles
Browse latest Browse all 3285

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>