2

Hi I want to store some values from :new.payload via an trigger.

this works in sql-developer but not in a trigger...

select json_value('{"timestamp":"2019-05-09T14:00:00Z","value":0,"unit":"W/m²"}', '$.unit') from dual;

'{"timestamp":"2019-05-09T14:00:00Z","value":0,"unit":"W/m²"}' is my :new.payload

i tried also:

SELECT unit INTO v_unit
    FROM
        json_table(:new.payload, '$'
            columns (
                    timestamp VARCHAR2(80) path '$.timestamp',
                    value NUMBER path '$.value',
                    unit VARCHAR2(80) path '$.unit'
                    )
) jt;

i get the error ORA-00904: "DECL_OBJ#" ;/

(Error: ORA-00604: Recursive Error SQL-Level 1 ORA-00904: "DECL_OBJ #": invalid ID)

1
  • Please edit the question and show the entire error including call stack. Thanks Commented May 9, 2019 at 15:42

1 Answer 1

6

This is a wild guess, but try this:

1.Open SQL Developer Set the PLScope identifiers parameter (Tools > Preferences > Database > PL/SQL Compiler > PLScope identifiers) from All to None.

  1. Close and open the SQL Developer
Sign up to request clarification or add additional context in comments.

3 Comments

that's it? Really? okay ... why does that work now?
I looked for that error on the Oracle support site and found notes about it. It is an internal oracle error. You would need an oracle support account to get the details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.