Christian Fritz wrote :

>Hello

>I don't succeed in using a synonym for an other user's sequence
>in SAP DB 7.4 (Kernel 7.4.3 Build 014-120-037-952) on Windows.
>Am I doing something wrong or does SAPDB not (yet) support this?

>Here some sample SQL code in order for you to reproduce the scene:


>**** UserA ****
>   CREATE SEQUENCE my_globalid INCREMENT BY 1 START WITH 1000000 CACHE
>500 NOCYCLE
>   //
>   CREATE PUBLIC SYNONYM my_globalid FOR my_globalid
>   //
>   GRANT SELECT ON my_globalid TO userB
>   //
>--> these statements got executed successfully


>**** UserB ****
>   SELECT userA.my_globalid.nextval FROM dual
>   //
>--> this works well and yields 1000001, then 1000002, then 1000003 ...

>   SELECT my_globalid.nextval FROM dual
>   //
>--> this results in an error: "Unknown sequence name". Why?


>I would expect the same behaviour as with the first statement, since
>the PUBLIC SYNONYM exists and the SELECT privilege is granted.
>(With my tables and views, the hole thing worked fine.)

>Okay, the "Reference Manual: SAP DB 7.4" only talks about
>"[...] FOR <table_name>", not about "[...] FOR <sequence_name>":

>   <create_synonym_statement> ::=
>   CREATE [PUBLIC] SYNONYM [<owner>.]<synonym_name> FOR <table_name>

>But since it neither does talk about "[...] FOR <view_name>" -- although
>that works -- the manual is not quite accurate anyway...


>So here are my questions:
>- What am I doing wrong?
>- Why, when "CREATE PUBLIC SYNONYM my_globalid FOR my_globalid" executes
>  successfully, one cannot use it?
>- Most interesting: How can I use a synonym for an other user's
>  sequence?
>- If it's a bug, when is it scheduled to be fixed? Is there any
>  workaround in the meantime?

You are doing nothing wrong, instead there's simply a bug in the name resolution of
public synonyms for sequences.
It's relatively simple to fix the bug, so you can expect it very soon. There 
unfortunately is no workaround in the meantime.

Thomas  
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to