cancel
Showing results for 
Search instead for 
Did you mean: 

transport stored procedure with different schema in source and target

kgaurav2k14
Participant
0 Kudos

Hi Friends,

I have written a stored procedure with tables from schema - "DEV" in my source hana system and the same tables are under a different schema "QAL" in target hana system.

I have to transport this stored procedure, how will this work?

For Ex :

I have written below statement in Stored procedure in Source HANA system:

select * from "DEV"."MARA"

However, in Target it has to become "QAL"."MARA" after transport.

Schema Mapping will not help in this scenario, Please help.

Thanks,

Gaurav

Accepted Solutions (0)

Answers (2)

Answers (2)

pfefferf
Active Contributor
0 Kudos

You are talking about a XS Classic Procedure?

Schema Mapping can be helpful here too. You have to set the DEFAULT SCHEMA in the procedure header to the authoring schema defined in the schema mapping. Within the body, you don't have to specify the schema name for the objects which should refer to the default schema. With that and the corresponding schema mapping on the Dev system, the select is applied to your DEV schema and on your Q system to your QAL schema.

Dummy coding for orientation:

PROCEDURE <procedure name> ( )
   LANGUAGE SQLSCRIPT
   SQL SECURITY INVOKER
   DEFAULT <authoring schema name>
   READS SQL DATA AS
BEGIN
   lt_test = select * from "MARA";
END

Regards,
Florian

former_member302041
Contributor
0 Kudos

Hi,

I'd suggest you to create a simple calculation view on MARA.

Then, in procedure, call that calculation view (it will be always "_SYS_BIC"."YOUR_CALCULATION_VIEW".

BR,