Dear All,
I faced unusual behaviour while putting filter in where clause. It is working fine when direct value(MILLER) is provided but throws the below error in SQL Developer and database getting disconnected when the value stored in the variable i.e l_ename used. Please help.
Error report -
No more data to read from socket
ALTER TABLE EMP ADD JSON_DATA VARCHAR2(100);
update EMP SET JSON_DATA ='{"data": {"ename": "MILLER"}}'WHERE ENAME ='MILLER' ;
update EMP SET JSON_DATA ='{"data": {"ename": "KING"}}'WHERE ENAME ='KING' ;
commit;
DECLARE
l_ename VARCHAR2(20) := 'MILLER';
l_exists NUMBER;
BEGIN
SELECT
1
INTO l_exists
FROM
emp,
JSON_TABLE ( json_data, '$.data'
COLUMNS (
newename VARCHAR2 PATH '$.ename'
)
)
t
WHERE
deptno = 10
AND t.newename = 'MILLER';--l_ename
END;
Regards.