ORDS plsql api

    The RESTful Service Code

    This will REST enable the schema and publish the RESTful Service for executing our Stored Procedure.
    -- Generated by Oracle SQL Developer REST Data Services 18.3.0.236.0501
    -- Exported REST Definitions from ORDS Schema Version 18.2.0.r1831332
    -- Schema: HR   Date: Sun Aug 26 10:54:01 EDT 2018
    --
    BEGIN
        ords.enable_schema(
            p_enabled               => TRUE,
            p_schema                => 'HR',
            p_url_mapping_type      => 'BASE_PATH',
            p_url_mapping_pattern   => 'hr',
            p_auto_rest_auth        => FALSE
        );
     
        ords.define_module(
            p_module_name      => 'youtube',
            p_base_path        => '/youtube/',
            p_items_per_page   => 25,
            p_status           => 'PUBLISHED',
            p_comments         => NULL
        );
     
        ords.define_template(
            p_module_name   => 'youtube',
            p_pattern       => 'pack_proc',
            p_priority      => 0,
            p_etag_type     => 'HASH',
            p_etag_query    => NULL,
            p_comments      => NULL
        );
     
        ords.define_handler(
            p_module_name      => 'youtube',
            p_pattern          => 'pack_proc',
            p_method           => 'POST',
            p_source_type      => 'plsql/block',
            p_items_per_page   => 0,
            p_mimes_allowed    => 'application/json',
            p_comments         => NULL,
            p_source           => 'DECLARE
      comes_out VARCHAR2(200);
    BEGIN
     
      REST_DEMO_IN_OUT.DEMO(
        X => :goes_in,
        Y => comes_out
      );
     
     :y := comes_out;
    END;'
        );
     
        ords.define_parameter(
            p_module_name          => 'youtube',
            p_pattern              => 'pack_proc',
            p_method               => 'POST',
            p_name                 => 'y',
            p_bind_variable_name   => 'y',
            p_source_type          => 'RESPONSE',
            p_param_type           => 'STRING',
            p_access_method        => 'OUT',
            p_comments             => NULL
        );
     
        COMMIT;
    END;

Comments

Popular posts from this blog

Flutter for Single-Page Scrollable Websites with Navigator 2.0

A Data Science Portfolio is More Valuable than a Resume

Better File Storage in Oracle Cloud