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
sql regex oracle oracle-sqldeveloper
add a comment |
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
sql regex oracle oracle-sqldeveloper
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
@GordonLinoff28-OCT-18
would be returned as I want MAX(IDDate)
– Matt
yesterday
add a comment |
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
sql regex oracle oracle-sqldeveloper
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
sql regex oracle oracle-sqldeveloper
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
@GordonLinoff28-OCT-18
would be returned as I want MAX(IDDate)
– Matt
yesterday
add a comment |
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
@GordonLinoff28-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
add a comment |
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.
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
add a comment |
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.
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
add a comment |
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.
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
add a comment |
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.
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.
answered yesterday
Jacek Wróbel
809314
809314
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
add a comment |
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
ORA-600 - go straight to Support.
– thatjeffsmith
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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