Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2002
    Posts
    10

    Angry Unanswered: Sequences/Synonyms

    Anyone seen this problem:

    >select nextval for OWNER.S_SEQUENCE from sysibm.sysdummy1

    1
    -----------
    3

    1 record(s) selected.

    >create synonym S_SEQUENCE for OWNER.S_SEQUENCE
    SQL0403W The newly defined alias "USER.S_SEQUENCE" resolved to the object "OWNER.S_SEQUENCE" which is currently undefined. SQLSTATE=01522

    >select nextval for S_SEQUENCE from sysibm.sysdummy1
    SQL0204N "OWNER.S_SEQUENCE" is an undefined name. SQLSTATE=42704

    Seems I can only use a sequence if I own it?

  2. #2
    Join Date
    Dec 2003
    Location
    Minneapolis
    Posts
    7
    Did you ever hear anything about this? I'm curious about this as well.

  3. #3
    Join Date
    Oct 2002
    Posts
    10
    No, sorry, just set the sequences up in the connecting user's schema.

  4. #4
    Join Date
    Dec 2003
    Location
    Minneapolis
    Posts
    7
    Originally posted by Ae589
    No, sorry, just set the sequences up in the connecting user's schema.
    That's what we're probably going to end up doing also.

  5. #5
    Join Date
    Oct 2002
    Posts
    10
    That worked in our situation, as it was a web app with one connecting user. If you had many users accessing the same synonym, then I would wrap it, or the whole insert, in a stored proc. I have more experience on Oracle stored procs than DB2 though, so this may not be appropriate.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •