cancel
Showing results for 
Search instead for 
Did you mean: 

Throws an error while creating a procedure

former_member208246
Participant
0 Kudos

Hi

Trying to create a sample procedure !!!!!!!!!! Results in the error...

Below is the screen shot for your reference.

Resulted in the error as : SAP DBTech JDBC: [1310] (at 163): scalar type is not allowed: PB_T1: line 4 col 7 (at pos 163)

Can any one let me know how to customize the coding and populate the data??

Best

Sanjay

Accepted Solutions (0)

Answers (2)

Answers (2)

rindia
Active Contributor
0 Kudos

Hi Sanjay,

Try like this:

drop type "SANJAYM"."PB_T1";

create type "SANJAYM"."PB_T1" AS TABLE (PROD_ID INT, BRAND_NAME NVARCHAR (30));

drop procedure "SANJAYM"."SAMPLE";

create procedure "SANJAYM"."SAMPLE" (IN PROD_ID INTEGER, IN BRAND_NAME VARCHAR, OUT OUT1 "SANJAYM"."PB_T1")

LANGUAGE SQLSCRIPT READS SQL DATA AS

BEGIN

  OUT1 = SELECT PROD_ID , BRAND_NAME  FROM "SANJAYM"."PRODUCT" GROUP BY PROD_ID;

END;

Regards

Raj

shanthi_bhaskar
Active Contributor
0 Kudos

Mohan,

your var_out is Varchar type so it cannot hold the two cloumns product & Brand.

You should use TABLE TYPE HERE.

CREATE TYPE I_TEMP AS TABLE

{

PRODUCT(10)  INTERGER,

BRAND(10) VARCHAR

}

OUT pt_t1 I_TEMP  should be in your var_out.

http://help.sap.com/hana/html/sql_create_table.html