AS400 rpgle встроенный SQL с помощью чувствительного курсора с более () - PullRequest
1 голос
/ 02 октября 2019

Язык: RPGLE

  exec sql
    declare    c1_RC0113_PLP04
    sensitive
    scroll
    cursor for
    select     ROW_NUMBER() over ( order by A4KQTT ) as rownbr,
               A4KQTT,
               A4SCAC,
               '0',
               ' '
    from       PLP04
    where      A4KQTT >= :#SCACDESC
    and        A4A8TA  = 'A'
    and        A4KQTT  > ' '
    order by   A4KQTT;
SQL Error:
 Message ID . . . . . . :   SQL0243       Severity . . . . . . . :   30        
 Message type . . . . . :   Diagnostic                                         
 Date sent  . . . . . . :   10/01/19      Time sent  . . . . . . :   16:55:33  

 Message . . . . :   SENSITIVE cursor C1_RC0113_PLP04 cannot be defined for the
   specified SELECT statement.                                                 
 Cause . . . . . :   The cursor C1_RC0113_PLP04 is defined as SENSITIVE but the
   query requires the creation of a temporary result table.  If the SELECT     
   statement has a data change table reference, it requires a temporary result 
   table.  A SENSITIVE cursor cannot be implemented.                           
 Recovery  . . . :   Redefine the cursor as ASENSITIVE or INSENSITIVE or change
   the query so that it no longer requires the creation of a temporary result  
   table.                                                                      

Я предполагаю, что получаю сообщение об ошибке из-за over ()?

Причина, по которой я использую чувствительный, заключается в том, что я хочу показать вставки/ обновляет файл, если они происходят.

Заранее спасибо.

1 Ответ

1 голос
/ 02 октября 2019

Да.
Необходимо материализовать курсор для вычисления результата такой функции OLAP для каждой строки. Вот почему вы не можете определить его как чувствительный.

...