Oracle SQL ORA-00600: Error with GREATEST and regexp_replace sub query









up vote
0
down vote

favorite












I have a small piece of code which has a sub query using the regexp_replace function to get a time stamp and this is inside a GREATEST function to get the highest date from this and a field in the outer query.



The data I am using in the sub query looks like this:



IDDate IDKeys
17-DEC-16 Q=INT^A_NO=123^
03-OCT-18 B_ID=123^
18-OCT-18 C_ID=123^
28-OCT-18 C_ID=123^


If I run this segment of code:



SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = '123'
AND LEFT(IDKeys, 1) = 'C'


It returns the correct information



GDATE
28-OCT-18


However when I incorporate this into the outer query as a sub query like this:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c


I get the following error:



ORA-00600: internal error code, arguments: [kkqcsfixfro:1 -- frooutj], , , , , , , , , , , 
00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause: This is the generic internal error number for Oracle program
exceptions. It indicates that a process has encountered a low-level,
unexpected condition. The first argument is the internal message
number. This argument and the database version number are critical in
identifying the root cause and the potential impact to your system.



EDIT




This works if I use SUBSTR and INSTR functions rather than regexp_replace:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE SUBSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), INSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), '=') + 1) = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c









share|improve this question



















  • 2




    Well, you probably found a bug in Oracle :-)
    – dnoeth
    yesterday






  • 1




    @Matt . . . I'm confused. Given your initial data, 18-Oct and 28-Oct should both be returned. Are you sure there is not another error causing this problem? Nevertheless, you should not be getting internal Oracle errors.
    – Gordon Linoff
    yesterday











  • @GordonLinoff 28-OCT-18 would be returned as I want MAX(IDDate)
    – Matt
    yesterday














up vote
0
down vote

favorite












I have a small piece of code which has a sub query using the regexp_replace function to get a time stamp and this is inside a GREATEST function to get the highest date from this and a field in the outer query.



The data I am using in the sub query looks like this:



IDDate IDKeys
17-DEC-16 Q=INT^A_NO=123^
03-OCT-18 B_ID=123^
18-OCT-18 C_ID=123^
28-OCT-18 C_ID=123^


If I run this segment of code:



SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = '123'
AND LEFT(IDKeys, 1) = 'C'


It returns the correct information



GDATE
28-OCT-18


However when I incorporate this into the outer query as a sub query like this:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c


I get the following error:



ORA-00600: internal error code, arguments: [kkqcsfixfro:1 -- frooutj], , , , , , , , , , , 
00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause: This is the generic internal error number for Oracle program
exceptions. It indicates that a process has encountered a low-level,
unexpected condition. The first argument is the internal message
number. This argument and the database version number are critical in
identifying the root cause and the potential impact to your system.



EDIT




This works if I use SUBSTR and INSTR functions rather than regexp_replace:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE SUBSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), INSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), '=') + 1) = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c









share|improve this question



















  • 2




    Well, you probably found a bug in Oracle :-)
    – dnoeth
    yesterday






  • 1




    @Matt . . . I'm confused. Given your initial data, 18-Oct and 28-Oct should both be returned. Are you sure there is not another error causing this problem? Nevertheless, you should not be getting internal Oracle errors.
    – Gordon Linoff
    yesterday











  • @GordonLinoff 28-OCT-18 would be returned as I want MAX(IDDate)
    – Matt
    yesterday












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a small piece of code which has a sub query using the regexp_replace function to get a time stamp and this is inside a GREATEST function to get the highest date from this and a field in the outer query.



The data I am using in the sub query looks like this:



IDDate IDKeys
17-DEC-16 Q=INT^A_NO=123^
03-OCT-18 B_ID=123^
18-OCT-18 C_ID=123^
28-OCT-18 C_ID=123^


If I run this segment of code:



SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = '123'
AND LEFT(IDKeys, 1) = 'C'


It returns the correct information



GDATE
28-OCT-18


However when I incorporate this into the outer query as a sub query like this:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c


I get the following error:



ORA-00600: internal error code, arguments: [kkqcsfixfro:1 -- frooutj], , , , , , , , , , , 
00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause: This is the generic internal error number for Oracle program
exceptions. It indicates that a process has encountered a low-level,
unexpected condition. The first argument is the internal message
number. This argument and the database version number are critical in
identifying the root cause and the potential impact to your system.



EDIT




This works if I use SUBSTR and INSTR functions rather than regexp_replace:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE SUBSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), INSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), '=') + 1) = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c









share|improve this question















I have a small piece of code which has a sub query using the regexp_replace function to get a time stamp and this is inside a GREATEST function to get the highest date from this and a field in the outer query.



The data I am using in the sub query looks like this:



IDDate IDKeys
17-DEC-16 Q=INT^A_NO=123^
03-OCT-18 B_ID=123^
18-OCT-18 C_ID=123^
28-OCT-18 C_ID=123^


If I run this segment of code:



SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = '123'
AND LEFT(IDKeys, 1) = 'C'


It returns the correct information



GDATE
28-OCT-18


However when I incorporate this into the outer query as a sub query like this:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE regexp_replace(IDKeys, '[^0-9]', '') = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c


I get the following error:



ORA-00600: internal error code, arguments: [kkqcsfixfro:1 -- frooutj], , , , , , , , , , , 
00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause: This is the generic internal error number for Oracle program
exceptions. It indicates that a process has encountered a low-level,
unexpected condition. The first argument is the internal message
number. This argument and the database version number are critical in
identifying the root cause and the potential impact to your system.



EDIT




This works if I use SUBSTR and INSTR functions rather than regexp_replace:



SELECT DISTINCT
c.P_ID,
GREATEST((SELECT MAX(IDDate) GDATE
FROM HHL h
WHERE SUBSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), INSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), '=') + 1) = c.P_ID
AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
FROM CICC c






sql regex oracle oracle-sqldeveloper






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday

























asked yesterday









Matt

10.7k216495




10.7k216495







  • 2




    Well, you probably found a bug in Oracle :-)
    – dnoeth
    yesterday






  • 1




    @Matt . . . I'm confused. Given your initial data, 18-Oct and 28-Oct should both be returned. Are you sure there is not another error causing this problem? Nevertheless, you should not be getting internal Oracle errors.
    – Gordon Linoff
    yesterday











  • @GordonLinoff 28-OCT-18 would be returned as I want MAX(IDDate)
    – Matt
    yesterday












  • 2




    Well, you probably found a bug in Oracle :-)
    – dnoeth
    yesterday






  • 1




    @Matt . . . I'm confused. Given your initial data, 18-Oct and 28-Oct should both be returned. Are you sure there is not another error causing this problem? Nevertheless, you should not be getting internal Oracle errors.
    – Gordon Linoff
    yesterday











  • @GordonLinoff 28-OCT-18 would be returned as I want MAX(IDDate)
    – Matt
    yesterday







2




2




Well, you probably found a bug in Oracle :-)
– dnoeth
yesterday




Well, you probably found a bug in Oracle :-)
– dnoeth
yesterday




1




1




@Matt . . . I'm confused. Given your initial data, 18-Oct and 28-Oct should both be returned. Are you sure there is not another error causing this problem? Nevertheless, you should not be getting internal Oracle errors.
– Gordon Linoff
yesterday





@Matt . . . I'm confused. Given your initial data, 18-Oct and 28-Oct should both be returned. Are you sure there is not another error causing this problem? Nevertheless, you should not be getting internal Oracle errors.
– Gordon Linoff
yesterday













@GordonLinoff 28-OCT-18 would be returned as I want MAX(IDDate)
– Matt
yesterday




@GordonLinoff 28-OCT-18 would be returned as I want MAX(IDDate)
– Matt
yesterday












1 Answer
1






active

oldest

votes

















up vote
2
down vote













I suggest that you should create a service request to Oracle support. Seems like you face the Bug 19894622 - ORA-600 [kkqcsfixfro:1 -- frooutj] error occur in 12c (Doc ID 19894622.8). Affected software versions are Versions >= 12.1.0.1 but BELOW 12.2. You should at least verify with your dba what software version you have and if patching will solve the problem.



There is a walk around described in the note.



alter session set "_optimizer_unnest_scalar_sq"=false;


As you can see it refers to the hidden parameter which is set on the session level. If you want to set this parameter on instance level the best practice with such parameters is to confirm with Oracle Support that setting this parameter is recommended by them.






share|improve this answer




















  • ORA-600 - go straight to Support.
    – thatjeffsmith
    yesterday










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224481%2foracle-sql-ora-00600-error-with-greatest-and-regexp-replace-sub-query%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













I suggest that you should create a service request to Oracle support. Seems like you face the Bug 19894622 - ORA-600 [kkqcsfixfro:1 -- frooutj] error occur in 12c (Doc ID 19894622.8). Affected software versions are Versions >= 12.1.0.1 but BELOW 12.2. You should at least verify with your dba what software version you have and if patching will solve the problem.



There is a walk around described in the note.



alter session set "_optimizer_unnest_scalar_sq"=false;


As you can see it refers to the hidden parameter which is set on the session level. If you want to set this parameter on instance level the best practice with such parameters is to confirm with Oracle Support that setting this parameter is recommended by them.






share|improve this answer




















  • ORA-600 - go straight to Support.
    – thatjeffsmith
    yesterday














up vote
2
down vote













I suggest that you should create a service request to Oracle support. Seems like you face the Bug 19894622 - ORA-600 [kkqcsfixfro:1 -- frooutj] error occur in 12c (Doc ID 19894622.8). Affected software versions are Versions >= 12.1.0.1 but BELOW 12.2. You should at least verify with your dba what software version you have and if patching will solve the problem.



There is a walk around described in the note.



alter session set "_optimizer_unnest_scalar_sq"=false;


As you can see it refers to the hidden parameter which is set on the session level. If you want to set this parameter on instance level the best practice with such parameters is to confirm with Oracle Support that setting this parameter is recommended by them.






share|improve this answer




















  • ORA-600 - go straight to Support.
    – thatjeffsmith
    yesterday












up vote
2
down vote










up vote
2
down vote









I suggest that you should create a service request to Oracle support. Seems like you face the Bug 19894622 - ORA-600 [kkqcsfixfro:1 -- frooutj] error occur in 12c (Doc ID 19894622.8). Affected software versions are Versions >= 12.1.0.1 but BELOW 12.2. You should at least verify with your dba what software version you have and if patching will solve the problem.



There is a walk around described in the note.



alter session set "_optimizer_unnest_scalar_sq"=false;


As you can see it refers to the hidden parameter which is set on the session level. If you want to set this parameter on instance level the best practice with such parameters is to confirm with Oracle Support that setting this parameter is recommended by them.






share|improve this answer












I suggest that you should create a service request to Oracle support. Seems like you face the Bug 19894622 - ORA-600 [kkqcsfixfro:1 -- frooutj] error occur in 12c (Doc ID 19894622.8). Affected software versions are Versions >= 12.1.0.1 but BELOW 12.2. You should at least verify with your dba what software version you have and if patching will solve the problem.



There is a walk around described in the note.



alter session set "_optimizer_unnest_scalar_sq"=false;


As you can see it refers to the hidden parameter which is set on the session level. If you want to set this parameter on instance level the best practice with such parameters is to confirm with Oracle Support that setting this parameter is recommended by them.







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Jacek Wróbel

809314




809314











  • ORA-600 - go straight to Support.
    – thatjeffsmith
    yesterday
















  • ORA-600 - go straight to Support.
    – thatjeffsmith
    yesterday















ORA-600 - go straight to Support.
– thatjeffsmith
yesterday




ORA-600 - go straight to Support.
– thatjeffsmith
yesterday

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224481%2foracle-sql-ora-00600-error-with-greatest-and-regexp-replace-sub-query%23new-answer', 'question_page');

);

Post as a guest














































































Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo