ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Embedded SQL & Named Activation Group Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedded SQL & Named Activation Group Issue

    We have some programs that are using a named activation group, but need to span over multiple data libraries to get data, using dynamic SQL cursors, over identical data models (think multiple, independent instances of the database for different store locations).

    When we try to qualify the libraries in the SQL code, however, the first data path that is opened is the one all of the cursors read over (the library qualification is ignored), even when we declare multiple cursors (one for each library).

    For example:

    Cursor 1: SELECT ITEM FROM DTA001/ITEMMASTER WHERE FOO = 'FOO'
    Cursor 2: SELECT ITEM FROM DTA002/ITEMMASTER WHERE FOO = 'FOO'
    Cursor 3: SELECT ITEM FROM DTA003/ITEMMASTER WHERE FOO = 'FOO'
    Cursor 4: SELECT ITEM FROM DTA004/ITEMMASTER WHERE FOO = 'FOO'

    As long as we use a named activation group, all four of these cursors read from DTA001.

    Is there a way to force the program to look at the correct library for each declared named cursor?

    We have some people starting to get really creative in their workarounds and I'm sure we're just missing something.
Working...
X