Skip to Content

SAP HANA 2.0 XSA Synonym to a stored procedure in a classical schema

My synonym for tables of a classical schema works but not a synonym to a stored procedure. just to be cautious I have grant ascess on the whole schema ( i did try by granting individual grants to table type and stored procedure)

GRANT SELECT, EXECUTE, UPDATE , DELETE , INSERT  ON SCHEMA TRAINING1 TO "TRAINING1::EXTERNAL_ACCESS";
GRANT SELECT, EXECUTE ,UPDATE , DELETE , INSERT ON SCHEMA TRAINING1 TO "TRAINING1::EXTERNAL_ACCESS_G" WITH GRANT OPTION;

The stored proc exists and I can run it from the classical SQL side but tying to a synonym of it in XSA , it fails and says that the object does not exist. Am I missing any authorization ?

{
  "PROJ1.DB::Synonym_0": {
    "target": {
      "object": "PROCX",
      "schema": "TRAINING1",
      "database": "SAHDB"
    }
  }
}

capture.jpg (16.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Mar 25 at 04:52 PM

    Hi,

    I am not sure if you can create a synonym for a stored procedure. I know it can be done for Tables and views in the system. One quick question, did you try to create the synonym using the graphical editor. Could you see the source schema and objects ?

    https://help.sap.com/viewer/52715f71adba4aaeb480d946c742d1f6/2.0.02/en-US/2a26e16e712c4dcaabd02f063fb88e05.html

    Also, if you have the execute privilege to the procedure, can you execute it directly from the SQL console (from the XSA, mapped to your container).

    Regards

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

    • ok I think I had misunderstood , about which container .. So I went back and again checked . If I open a SQL windows in the CONTAINER defined on the SERVICE . So in the SERVICE container i am seeing the SP and being able to call it too

  • Mar 26 at 05:05 AM

    Hi Ravindra

    I am being able to see the SP while in the Synonym graphical editor , but it does not do the build saying that the SP does not exist . Now I wont be able to execute from the SQL console of the XSA mappened container till the synonym is been BUILD .

    just to make sure I created a read only SP in the classical schema with the table type defined in the SP it self , as I could not see the table type from the services

    CREATE PROCEDURE TRAINING1.SP(OUT  O TABLE( ID INTEGER, NAME NVARCHAR(20)))  

    Also how do I monitor RAM and CPU per container ? and also set max limiting resources on it ?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10 at 07:04 PM

    Is the tenant of the procedure the same as the tenant mapped into the space of your project? The Value Help in the synonym editor will use the user provided service, but the deployer will use the space mapped tenant and they may not be the same. That is the most likely cause of the object not being found during the build.

    Also you should never grant access directly to container roles like EXTERNAL_ACCESS. Instead always use the hdbgrants to grant access upon build/deploy.

    Add comment
    10|10000 characters needed characters exceeded