Skip to Content

transport stored procedure with different schema in source and target

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • 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,

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 12 at 05:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded