Forum Stats

  • 3,758,414 Users
  • 2,251,384 Discussions
  • 7,870,187 Comments

Discussions

Getting below error while using apex_web_service.append( PL SQL/Oracle apex)

Hi Oracle team,

Our oracle apex version: Application Express 20.2.0.00.20

DB version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0

I am getting below error while execution :

DECLARE

  l_multipart  apex_web_service.t_multipart_parts;

   l_clob  CLOB;

BEGIN

  l_clob:=apex_web_service.append (

    p_multipart  => l_multipart,

    p_name     => 'param1',

    p_content_type => 'application/json',

    p_body     => '{"hello":"world"}' );

  dbms_output.put_line(l_clob);   

END;


/////

DECLARE

  l_multipart  apex_web_service.t_multipart_parts;

  l_request_blob blob;


  l_orig blob;

BEGIN

   select orig into l_orig from b_test

               where seq=4;

apex_web_service.append (

    p_multipart  => l_multipart,

    p_name     => 'attachment',

    p_content_type => 'application/octet-stream',

    p_body_body  =>l_orig );

  l_request_blob := apex_web_service.generate_request_body (

              p_multipart  => l_multipart );   

    dbms_output.put_line(1);

END;


Error report -

ORA-06550: line 5, column 30:

PLS-00302: component 'APPEND' must be declared

ORA-06550: line 5, column 5:

PL/SQL: Statement ignored

06550. 00000 - "line %s, column %s:\n%s"

*Cause:  Usually a PL/SQL compilation error.

*Action:


Please let me know what mistake I am doing in the code ?

Regards,

Ritu

Best Answer

Answers

  • cormaco
    cormaco Member Posts: 1,677 Bronze Crown
    Accepted Answer

    This seems to be a documentation bug.

    The name of the procedure is APPEND_TO_MULTIPART, but in the example on this page which you tried to execute the name is only APPEND:


  • User_VC17R
    User_VC17R Member Posts: 11 Green Ribbon

    Hi Cormako,


    Thanks for your prompt help and very greatful.

    But I have query, how I can pass 'l_request_blob' generated from below codes:

    l_request_blob := apex_web_service.generate_request_body (

                  p_multipart  => l_multipart ); 

    to below procedure ' apex_web_service.make_rest_request' , that is,in which parameter of this procedure.

    I am confused as l_request_blob in BLOB type

    APEX_WEB_SERVICE.MAKE_REST_REQUEST(
        p_url                  IN VARCHAR2,
        p_http_method          IN VARCHAR2,
        p_username             IN VARCHAR2 DEFAULT NULL,
        p_password             IN VARCHAR2 DEFAULT NULL,
        p_scheme               IN VARCHAR2 DEFAULT 'Basic',
        p_proxy_override       IN VARCHAR2 DEFAULT NULL,
        p_transfer_timeout     IN NUMBER   DEFAULT 180,
        p_body                 IN CLOB DEFAULT EMPTY_CLOB(),
        p_body_blob            IN BLOB DEFAULT EMPTY_BLOB(),
        p_parm_name            IN apex_application_global.VC_ARR2 DEFAULT empty_vc_arr,
        p_parm_value           IN apex_application_global.VC_ARR2 DEFAULT empty_vc_arr,
        p_wallet_path          IN VARCHAR2 DEFAULT NULL,
        p_wallet_pwd           IN VARCHAR2 DEFAULT NULL,
        p_https_host           IN VARCHAR2 DEFAULT NULL,
        p_credential_static_id IN VARCHAR2 DEFAULT NULL,
        p_token_url            IN VARCHAR2 DEFAULT NULL )  
    RETURN CLOB;
    

    Note : l_multipart is combination of json and attachment

    Thanks in advance for your support

    Regards,

    Ritu

  • cormaco
    cormaco Member Posts: 1,677 Bronze Crown