Skip to Content
0

transport stored procedure with different schema in source and target

Mar 09 at 07:17 AM

92

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Andrey Uryukin Mar 11 at 02:12 PM
-1

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,

Share
10 |10000 characters needed characters left characters exceeded
Florian Pfeffer
Mar 12 at 05:52 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded