cancel
Showing results for 
Search instead for 
Did you mean: 

MaxDB 7.7.06.10 - error in SELECT MAX

Former Member
0 Kudos

Dear experts,

one of our customers has a live installation of SAP ECC 6.04 based on Linux and MaxDB version 7.7.06.10. I recently took over the maintenance of the system, and following the recommendations of the Early Watch Alerts I've scheduled various maintenance jobs via transaction DBACOCKPIT, among them DB13CMirror.

This job now fails with a SAPSQL_ARRAY_INSERT_DUPREC dump. While debugging the code I've found what I think is a bug in the MaxDB database engine.

In method LOGS_OF_PERIOD_DB13C of class CL_DBA_DB13C_BACKEND there's a SELECT on table DB6PMPROT that should extract the MAX value of field STARTTIME (which is declared as a CHAR 14). I've traced the command via tr. ST05 and this is the full SQL statement:

SELECT
 MAX ("STARTTIME")
FROM
  "DB6PMPROT"
WHERE
  "SYSTEM_ID" = 'PRD' AND ( "PROGID" = 'ALLNC' OR "PROGID" = 'ALL' OR "PROGID" =
  'PAGNC' OR "PROGID" = 'PAGE' OR "PROGID" = 'AUON' OR "PROGID" = 'AUOFF' OR
  "PROGID" = 'LOG' OR "PROGID" = 'UPD2' OR "PROGID" = 'UPD3' OR "PROGID" =
  'UPD1' OR "PROGID" = 'VERI' OR "PROGID" = 'VERI1' OR "PROGID" = 'VERI2' OR
  "PROGID" = 'VERI3' OR "PROGID" = 'VERIX' OR "PROGID" = 'GENER' OR "PROGID" =
  'COLTS' OR "PROGID" = 'ARCHF' OR "PROGID" = 'CDBCK' OR "PROGID" = 'CPBCK' OR
  "PROGID" = 'CLBCK' )

Now, if I run this SELECT statement directly in DB Studio:

SELECT
 "STARTTIME"
FROM
  "DB6PMPROT"
WHERE
  "SYSTEM_ID" = 'PRD' AND ( "PROGID" = 'ALLNC' OR "PROGID" = 'ALL' OR "PROGID" =
  'PAGNC' OR "PROGID" = 'PAGE' OR "PROGID" = 'AUON' OR "PROGID" = 'AUOFF' OR
  "PROGID" = 'LOG' OR "PROGID" = 'UPD2' OR "PROGID" = 'UPD3' OR "PROGID" =
  'UPD1' OR "PROGID" = 'VERI' OR "PROGID" = 'VERI1' OR "PROGID" = 'VERI2' OR
  "PROGID" = 'VERI3' OR "PROGID" = 'VERIX' OR "PROGID" = 'GENER' OR "PROGID" =
  'COLTS' OR "PROGID" = 'ARCHF' OR "PROGID" = 'CDBCK' OR "PROGID" = 'CPBCK' OR
  "PROGID" = 'CLBCK' )

I get the following results (I'm just copying 10 lines here, to give you the idea of what's happening):

20120305220000
20120306220000
20120307220000
20120226080000
20120304080000
20120226070000
20120304070000
20120226090000
20120304090000
20120226100000
20120304100000

Now given the data I would expect the SELECT MAX statement over there to return 20120307220000,

instead I get 20120304100000! This is wrong because 20120307220000 is greater than 20120304100000.

This is why the report works on lines it has already processed and gives the SAPSQL_ARRAY_INSERT_DUPREC dump.

Just to be sure I used ORDER BY "STARTTIME" and if I do this, 20120307220000 is placed after 20120304100000 as it should be.

What's happening here? Is there a way to fix this?

Thank you very much for your support.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have updated MaxDB to the latest available patch level for version 7.7 (7.7.07.41) and the problem seems to be solved.

thorsten_zielke
Contributor
0 Kudos

Thank you for sharing how you fixed this despite the lack of response from the forum 🙂

It is always good to have a thread answered - who knows who will find this having the same issue.

Answers (0)