title: Modify Oracle Package code
body: <p>I have added two fields to a table called CartRequests. We store JSON text in this table sent from our e-commerce package for each of our online orders. This helps us to be able to rebuild orders that fail for any reason. I am adding these 2 fields to facilitate faster searches because, currently, we have to only search the json (CR_JSON) text for values and it takes anywhere from 30 secs to a minute to find anything using a like clause. Most of the time, we are searching for either the CustomerID or OrderID.</p>
  
  <p>I have the following package that puts the sent JSON into the CartRequests table, it was written 
  by another developer more familiar with PL/SQL:</p>
  
  <pre><code>CREATE OR REPLACE PACKAGE BODY CIC3.CartJSON AS
      gCr_id          number;
      gRequestMsg     varchar2(32000);
      gResponseMsg    varchar2(32000);
      gMessageJSON    w_MessageJSON_t;
      gJSON           JSON.JSONStructObj;
  
      procedure SaveRequest is
      begin
          select CartRequestsSeq.nextval into gCr_id from dual;
          insert into CartRequests (cr_id, cr_date ,cr_json) values (gCr_id, sysdate, gRequestMsg);
      end;
  
      procedure ExtractRequest is
          i       number;
          vJSON   JSON.JSONStructObj;
      begin
          i:=-1;
          vJSON:=JSON.String2JSON(gRequestMsg);
          NewJMessageJSON(gMessageJSON,vJSON,i);
  
          gJSON:=JSON.String2JSON(gMessageJSON.ObjectSent);
  
          update CartRequests set
                  cr_CartTime=gMessageJSON.CartTime,
                  cr_ObjectSent=gMessageJSON.ObjectSent 
                 -- ***************************************************************
                 -- I'd like to add these fields but getting following errors:
                 -- PLS-00487 (39: 27): PLS-00487: Invalid reference to variable 'OBJECTSENT'
                 -- ORA-00904 (39: 27): PL/SQL: ORA-00904: "GMESSAGEJSON"."OBJECTSENT"."CUSTOMERID": invalid identifier
                 -- ***************************************************************
                 -- cr_OrderID=gMessageJSON.ObjectSent.OrderID,      -- Adding this field
                 -- cr_CustomerID=gMessageJSON.ObjectSent.CustomerID -- Adding this field
          where cr_id=gCr_id;            
      end;
  
  END CartJSON;
  /
  </code></pre>
  
  <p>How can I add these 2 fields with no errors?</p>
  
  <pre><code>CREATE OR REPLACE type CIC3.W_MESSAGEJSON_T as object (
       CartTime       Varchar2(30),
       ObjectSent     Varchar2(4000),
  /
  </code></pre>