Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting Following: Pl/SQL Function Body Type Select List: Error ORA-20987: APEX - JSON.WRITER.NOT_OP

Dj SteeleMay 14 2020 — edited May 15 2020

I'm using Application Express 20.1.0.00.13 , Oracle 12C Database and Google Chrome

I'm getting the above error when trying to save the Page

and this error within the Page

1 error has occurred

  • Error: SyntaxError: Unexpected token { in JSON at position 255

This involves a page item that I'm trying to make a Radio Dial or Select List with the Source Type of a PL/SQL Function Body Returning SQL Query

I have tried to replicate on Apex.Oracle.com but Have Not been able to 

Here is a Screenshot of thePL/SQL Function Body Returning SQL Query

declare

  v_query     varchar2(1000);

  v_nav_srce  varchar2(35) := 'Manage_Requisition_Vendor_Files';

begin

:P225_NAVIGATION_SOURCE := v_nav_srce;

             

        if trim(:P225_NAVIGATION_SOURCE) = 'Manage_Requisition_Vendor_Files'

        then

            v_query := 'select '||chr(39)||'PO'||chr(39)||','||chr(39)||'PO'||chr(39)||' from dual'||' Union '||'select '||chr(39)||'PC'||chr(39)||','||chr(39)||'PC'||chr(39)||' from dual'||

                 ' Union '||'select '||chr(39)||'TMP'||chr(39)||','||chr(39)||'TMP'||chr(39)||' from dual;';

      

      

        elsif trim(:P225_NAVIGATION_SOURCE) = 'Manage_Non-Renewal_Vendor_Files'

             then

              v_query := 'select '||chr(39)||'PO'||chr(39)||','||chr(39)||'PO'||chr(39)||' from dual'||' Union '||'select '||chr(39)||'PC'||chr(39)||','||chr(39)||'PC'||chr(39)||' from dual;';

            

       end if;      

  

    return v_query;

end;

Im confused because I'm using this same Code on a different Page and Do Not get the Error

The :P225_NAVIGATION_SOURCE) = 'Manage_Requisition_Vendor_Files'  is coming from

Shared Compents:  path  Shared Components / Lists / List Detais

I Changed 'Manage All Vendor Files to include underscores to:   Manage_All_Vendor_Files   Thinking it had to do something with "White Spaces"

but that didn't help

Also here is the SQL of the Interactive Grid of the Page in reference

You can see in the Where Clause where I reference the:  P225_REQ_TYPE which is the Page Item with Type:  Radio Group or Select List  (Both throw the above referenced error)

select

    DISTINCT rl.Req_ID, File_Num, v.name1 as "Vendor Name",rl.renewal_type,rl.omes_vendor_id,rl.odot_vendor_id

             ,rl.universal_id,rl.desc_of_purchase, rl.req_amount,

             rl.allotmentfundaccountid, rl.object_code, rl.req_num, rl.req_date, rl.alert_date, rl.renewal_date, rl.po_num,

             rl.po_date, rl.status_notes,capital_proj_fl,'Modify Requisition' as "Title"

from BUDGET_VENDOR_FILE rl

     LEFT OUTER join

     BUDGET_VENDOR_VW v

--on v.omes_vendor_id = rl.omes_vendor_id

--on v.omes_vendor_id = rl.universal_id -- OR v.odot_vendor_id = rl.universal_id

ON  (v.universal_id = rl.universal_id) -- or (rl.omes_vendor_id = v.universal_id)

where --((renewal_type in ('PO','PC') and :P225_NAVIGATION_SOURCE = 'Manage All Vendor Files' )) --1)

  

  --   trim(to_char(rl.FY)) = :P225_SELECT_FY -- AND*/ trim(to_char(rl.Renewal_Type)) = :P225_REQ_TYPE

--     AND

     ((((:P225_NAVIGATION_SOURCE = 'Manage_All_Vendor_Files' ))) AND (trim(to_char(rl.FY)) = :P225_SELECT_FY) AND trim(rl.Renewal_Type) = :P225_REQ_TYPE) --1)

      OR

     ((((renewal_type in ('PO') and to_char(:P225_NAVIGATION_SOURCE) = 'Manage_Requisition_Vendor_Files' ))) AND trim(to_char(rl.FY)) = :P225_SELECT_FY ) --2)

      OR

      ((((renewal_type in ('PC') and renewal_date is null and :P225_NAVIGATION_SOURCE = 'Manage_Non_Renewal_Vendor_Files' ))) AND (trim(to_char(rl.FY)) = :P225_SELECT_FY AND trim(rl.Renewal_Type) = :P225_REQ_TYPE)) --3)

      OR 

      (((renewal_type in ('TMP') and renewal_date is null and :P225_NAVIGATION_SOURCE = 'Manage_Temp_Vendor_Files' )) AND trim(to_char(rl.FY)) = :P225_SELECT_FY )

    

https://biapptest.odot.ok.gov/apexOTAT/f?p=4000:405:12400800046480:::::

:

Any Help would be appreciated

DSteele41

Thanks in Regards,

Comments
Post Details
Added on May 14 2020
1 comment
83 views