ORDS Setup plsql

Oracle Application Express is a rapid development tool for Web applications on the Oracle database.
Post Reply
admin
Posts: 2062
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

ORDS Setup plsql

Post by admin »

Code: Select all

DECLARE
    v_module_name   VARCHAR2 (200) DEFAULT 'erpstuff.com.hr';
    v_pattern       VARCHAR2 (200) DEFAULT 'dept/:deptno';

/*
This code is only for demo purposes so use this code in your environment at your own risk.
https://erpstuff.com
version:demo_1
22-JAN-2022
*/    
BEGIN
    ORDS.define_module (p_module_name      => v_module_name,
                        p_base_path        => '/xx_hr/',
                        p_items_per_page   => 0);

    ORDS.define_template (p_module_name   => v_module_name,
                          p_pattern       => v_pattern);

    ORDS.define_handler (
        p_module_name      => v_module_name,
        p_pattern          => v_pattern,
        p_method           => 'GET',
        p_source_type      => ORDS.source_type_collection_feed,
        p_source           => 'select * from dept where DEPTNO = :deptno',
        p_items_per_page   => 0);


    ORDS.define_parameter (p_module_name          => v_module_name,
                           p_pattern              => v_pattern,
                           p_method               => 'GET',
                           p_name                 => 'empno',
                           p_bind_variable_name   => 'empno',
                           p_source_type          => 'URI',
                           p_param_type           => 'STRING',
                           p_access_method        => 'IN');
END;

Code: Select all

DECLARE
    v_module_name   USER_ORDS_MODULES.name%type DEFAULT 'erpstuff.com.hr';
    v_pattern       user_ords_templates.uri_template%type DEFAULT 'dept/:deptno';

/*
This code is only for demo purposes so use this code in your environment at your own risk.
https://erpstuff.com
version:demo_1
22-JAN-2022
*/    
BEGIN

ORDS.DEFINE_SERVICE(
   p_module_name        => v_module_name, --ords_modules.name%type
   p_base_path          => '/xx_hr/', --ords_modules.uri_prefix%type
   p_pattern            => v_pattern, --ords_templates.uri_template%type
   p_method             => 'GET', --ords_handlers.method%type
   p_source_type        =>  ords.source_type_collection_feed, --ords_handlers.source_type%type
   p_source             => 'select * from dept where DEPTNO = :deptno', --ords_handlers.source%type,
   p_items_per_page     => 25, --
   p_status             => 'PUBLISHED', --ords_modules.status%type
   p_etag_type          => 'HASH', --ords_templates.etag_type%type
   p_module_comments    => NULL, --ords_modules.comments%type DEFAULT
   p_template_comments  => NULL, --ords_modules.comments%type DEFAULT 
   p_handler_comments   => NULL); --ords_modules.comments%type DEFAULT
   end;
Explanation in youtube videos,

https://youtu.be/p3F7KRSMaao
https://youtu.be/41z9e6zQO5g
https://youtu.be/SQZYExiN_-w
Malik Sikandar Hayat
admin@erpstuff.com
Post Reply

Who is online

Users browsing this forum: Google Adsense [Bot] and 2 guests