Announcement

Collapse
No announcement yet.

Nested grid

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

  • Nested grid

    SC nested grid works like this: for each record of the main grid a parameter is passed to the nested grid which is used to select the records of the nested grid.
    This parameter is normally a variable specified inside the WHERE clause of SQL statement for the nested grid.

    Something like this:

    SELECT
    T.MYFIELD
    FROM
    NESTED_TABLE AS T
    WHERE
    T.MYFIELD = [PAR]


    where [PAR] is derived from the current record of the main grid. I am assuming here that [PAR] is an integer value.
    So far so good.

    But what happen if the nested grid has a variable in the FROM part of the SELECT statement rather than the WHERE part ?

    Something like this:

    SELECT
    T.MYFIELD
    FROM
    TABLE(MYFUNCTION([PAR])) AS T
    WHERE
    T.MYFIELD > 0


    This is a perfectly legal SQL statement: MYFUNCTION is a SQL function returning a table and [PAR] is a parameter passed to MYFUNCTION.

    According to my tests in this latter case SC fails to substitute [PAR] with the actual value passed from the main grid.

    It looks like nested grid works ONLY if [PAR] is in the where clause but not in the FROM clause. To me this is a bug.
    Massimiliano Campagnoli
Working...
X