install log will write to "install.log", please check it after the script run press enter to continue Are you sure that you are in the noradle-demo project's root directory, if not, break(CTRL-C) and cd it and retry ... Are you sure you have clean empty DEMO db user/schema already? Noradle demo's units(tables,plsql,...) in oracle will be installed to the schema You can try the sql scripts below to achieve the preparation required above. drop user demo cascade; create user demo identified by demo default tablespace sysaux temporary tablespace temp; alter user demo quota unlimited on sysaux; if not, create empty DEMO db users beforehand, and then press enter to continue Enter the schema/User(must already exist) for noradle demo (demo) : Installing Noracle(psp.web) demo app to schema "demo" press enter to continue ... old 1: alter session set current_schema = &demodbu new 1: alter session set current_schema = demo Session altered. old 1: grant execute on SYS.DBMS_CRYPTO to &demodbu new 1: grant execute on SYS.DBMS_CRYPTO to demo Grant succeeded. old 1: grant execute on SYS.DBMS_LOCK to &demodbu new 1: grant execute on SYS.DBMS_LOCK to demo Grant succeeded. old 1: grant execute on SYS.DBMS_OBFUSCATION_TOOLKIT to &demodbu new 1: grant execute on SYS.DBMS_OBFUSCATION_TOOLKIT to demo Grant succeeded. old 1: grant execute on SYS.DBMS_OBFUSCATION_TOOLKIT_FFI to &demodbu new 1: grant execute on SYS.DBMS_OBFUSCATION_TOOLKIT_FFI to demo Grant succeeded. old 1: grant execute on SYS.DBMS_PIPE to &demodbu new 1: grant execute on SYS.DBMS_PIPE to demo Grant succeeded. old 1: grant execute on SYS.DBMS_HPROF to &demodbu new 1: grant execute on SYS.DBMS_HPROF to demo Grant succeeded. old 1: grant resource to &demodbu new 1: grant resource to demo Grant succeeded. old 1: grant create view to &demodbu new 1: grant create view to demo Grant succeeded. old 1: grant create session to &demodbu new 1: grant create session to demo Grant succeeded. begin to install Noradle demo schema objects Session altered. Session altered. ****** Creating REGIONS table .... Table created. Index created. Table altered. ****** Creating COUNTRIES table .... Table created. Table altered. ****** Creating LOCATIONS table .... Table created. Index created. Table altered. Sequence created. ****** Creating DEPARTMENTS table .... Table created. Index created. Table altered. Sequence created. ****** Creating JOBS table .... Table created. Index created. Table altered. ****** Creating EMPLOYEES table .... Table created. Index created. Table altered. Table altered. Sequence created. ****** Creating JOB_HISTORY table .... Table created. Index created. Table altered. ****** Creating EMP_DETAILS_VIEW view ... View created. Commit complete. Session altered. ****** Populating REGIONS table .... 1 row created. 1 row created. 1 row created. 1 row created. ****** Populating COUNTIRES table .... 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. ****** Populating LOCATIONS table .... 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. ****** Populating DEPARTMENTS table .... Table altered. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. ****** Populating JOBS table .... 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. ****** Populating EMPLOYEES table .... 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. ****** Populating JOB_HISTORY table .... 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. Table altered. Commit complete. Index created. Index created. Index created. Index created. Index created. Index created. Index created. Index created. Index created. Index created. Index created. Commit complete. Procedure created. Trigger created. Trigger altered. Procedure created. Trigger created. Commit complete. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Comment created. Commit complete. PL/SQL procedure successfully completed. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. 1 row created. SQL> SQL> whenever sqlerror continue SQL> prompt SQL> prompt Creating table TERM_T Creating table TERM_T SQL> prompt ===================== ===================== SQL> prompt SQL> @@term_t.tab SQL> create table TERM_T 2 ( 3 msid VARCHAR2(30) not null, 4 bgcolor VARCHAR2(30), 5 fgcolor VARCHAR2(30) 6 ) 7 ; Table created. SQL> alter table TERM_T 2 add constraint PK_TERM primary key (MSID); Table altered. SQL> SQL> prompt SQL> prompt Creating table USER_T Creating table USER_T SQL> prompt ===================== ===================== SQL> prompt SQL> @@user_t.tab SQL> create table USER_T 2 ( 3 name VARCHAR2(30) not null, 4 pass VARCHAR2(30) not null, 5 ctime DATE not null, 6 cache_id NUMBER 7 ) 8 ; Table created. SQL> comment on table USER_T 2 is 'users who can login to'; Comment created. SQL> alter table USER_T 2 add constraint PK_USER primary key (NAME); Table altered. SQL> SQL> prompt SQL> prompt Creating table PASSWD_HIS_T Creating table PASSWD_HIS_T SQL> prompt ===================== ===================== SQL> prompt SQL> @@passwd_his_t.tab SQL> create table PASSWD_HIS_T 2 ( 3 name VARCHAR2(30), 4 passwd VARCHAR2(30), 5 chg_time DATE 6 ) 7 ; Table created. SQL> SQL> prompt SQL> prompt Creating table EMP_T Creating table EMP_T SQL> prompt ========================== ========================== SQL> prompt SQL> @@emp_t.tab SQL> create table EMP_T 2 ( 3 pid NUMBER(4) not null, 4 name VARCHAR2(30), 5 ppid NUMBER(4) 6 ) 7 ; Table created. SQL> alter table EMP_T 2 add constraint PK_EMP primary key (PID); Table altered. SQL> alter table EMP_T 2 add constraint FK_EMP_PPID foreign key (PPID) 3 references EMP_T (PID) on delete set null; Table altered. SQL> SQL> prompt SQL> prompt Creating table STOLEN_COOKIE_T Creating table STOLEN_COOKIE_T SQL> prompt ============================== ============================== SQL> prompt SQL> @@stolen_cookie_t.tab SQL> create table STOLEN_COOKIE_T 2 ( 3 logtime DATE not null, 4 referer VARCHAR2(1000), 5 cookies VARCHAR2(4000), 6 ua VARCHAR2(1000) 7 ) 8 ; Table created. SQL> SQL> @@../demo_data/human_resources/my_main.sql SP2-0310: unable to open file "../demo_data/human_resources/my_main.sql" SQL> whenever sqlerror exit SQL> SQL> @@pc.spc SQL> create or replace package pc is 2 3 -- Author : ADMINISTRATOR 4 -- Created : 2015-1-8 16:00:32 5 -- Purpose : print common 6 7 procedure h 8 ( 9 target varchar2 := null, 10 title varchar2 := null 11 ); 12 13 end pc; 14 / Package created. SQL> @@pc.bdy SQL> create or replace package body pc is 2 3 procedure h 4 ( 5 target varchar2 := null, 6 title varchar2 := null 7 ) is 8 begin 9 if r.not_lack('inspect') then 10 return; 11 end if; 12 x.t(''); 13 x.o(''); 14 if target is not null or title is not null then 15 x.o('
'); 16 if target is not null then 17 x.s('', x.a('', 'execute', r.prog));
43 b.line('```plsql');
44 b.set_line_break('');
45 for i in (select a.text
46 from user_source a
47 where a.name = v_pack
48 and a.type = 'PACKAGE BODY'
49 order by a.line) loop
50 if not v_sts then
51 if i.text like v_proc and regexp_like(i.text, '\s' || v_prog(2) || '(\s|\()') then
52 v_sts := true;
53 end if;
54 end if;
55 if v_sts then
56 b.line(substrb(replace(i.text, chr(9), ' '), 3));
57 if i.text = chr(9) || 'end;' || chr(10) then
58 exit;
59 end if;
60 end if;
61 end loop;
62 b.line('```');
63 end;
64
65 -- print links to all sub procedures
66 procedure proc_list is
67 v_pack varchar2(30) := r.getc('pack', r.pack);
68 begin
69 x.t('');
70 x.o('');
71 x.o('');
72 x.l(' ', '[bootstrap.css]');
73 x.l(' ', '[animate.css]');
74 x.p(' ', st(l('^img/subtle_freckles.png')));
24 x.l('', '[bootstrap.css]');
25 x.j('');
47 src_b.header;
48 b.line('This page transfer-encoding setting is ' || r.getc('use', 'on') || ' Over, Full page is generated completely
');
49 b.line('This page print ' || r.getc('count', 100) || ' numbers
');
50 b.line('
');
51
52 b.line('');
64 b.line('When this page is print out at this point, it will wait a while for big data processing.
');
65 b.line('So it should use "b.flush" API to send the already generated part to client/browser.
');
66 b.line(x.e('You call b.flush after ');
90 b.line('');
91 for i in 1 .. 9 loop
92 b.line('LiNE, NO.' || i);
93 b.line('');
94 -- b.line(rpad(i, 300, i));
95 if r.is_lack('inspect') then
96 b.flush;
97 -- you may not force flush when h.auto_chunk_max_idle is set.
98 -- but you can close auto flush by call h.auto_chunk_max_idle(null);
99 dbms_lock.sleep(1);
100 end if;
101 end loop;
102 b.line('');
103 b.line('
');
111 end;
112 begin
113 h.content_type(r.getc('mime', 'text/html'));
114
115 b.line('');
116 b.line('
paragraph 1
'); 149 b.line('paragraph 2
'); 150 b.line('paragraph 3
'); 151 b.line('| A1 | B1 |
| A2 | B2 |
');
181 b.line(t.dt2s(sysdate));
182 b.line('refresh to ' || r.getc('to', 'self') || ' every ' || r.getn('interval', 3) || 's');
183 b.line('');
184 end;
185
186 procedure content_md5 is
187 begin
188 h.content_md5_on;
189 if r.getb('nozip', true) then
190 -- md5 is computed in Oracle
191 h.content_encoding_identity;
192 else
193 -- md5 is computed in NodeJS;
194 null;
195 end if;
196 src_b.header;
197 x.p('', 'Use http content-md5 header to ensure response body integrity.'); 198 x.p('
', 'Call h.conent_md5_on to automatically compute md5 of response body and set content-md5 header.'); 199 x.p('
', 'Content MD5 for the same page is diffrent for diffrent Content-Encoding'); 200 end; 201 202 end http_b; 203 / Package body created. SQL> prompt SQL> prompt Creating package COOKIE_H Creating package COOKIE_H SQL> prompt ======================= ======================= SQL> prompt SQL> @@cookie_h.spc SQL> create or replace package cookie_h is 2 3 procedure form_view; 4 5 procedure steal; 6 7 end cookie_h; 8 / Package created. SQL> @@cookie_h.bdy SQL> create or replace package body cookie_h is 2 3 procedure form_view is 4 n varchar2(100); 5 v varchar2(999); 6 begin 7 src_b.header; 8 x.l('', '[bootstrap.css]'); 9 x.o('
', 'insert the following text into form input to steal cookies'); 74 x.p('
', x.e(x.r('', r.dir_full))); 75 else 76 x.p('
', 'stolen cookie'); 77 x.t(r.getc('cookie')); 78 end if; 79 x.c(''); 80 81 x.t('
', 'This page will raise exception at odd seconds.'); 15 x.p('
', 'But you have luck, all is ok.');
16 end;
17
18 procedure on_developing is
19 begin
20 h.sts_501_not_implemented;
21 src_b.link_proc;
22 b.line('
This page is under development, please wait for it''s release.');
23 end;
24
25 procedure check_right is
26 begin
27 if mod(to_char(sysdate, 'ss'), 2) = 1 then
28 h.sts_403_forbidden;
29 pc.h;
30 src_b.link_proc;
31 x.p('
', 'You are not allowed to access this page at odd seconds'); 32 else 33 pc.h; 34 src_b.link_proc; 35 x.p('
', 'You are allowed to access this page at even seconds only'); 36 end if; 37 end; 38 39 procedure maybe_no_data is 40 v_pack varchar2(30) := upper(r.getc('pack', '')); 41 cur sys_refcursor; 42 begin 43 select count(*) 44 into tmp.cnt 45 from user_objects a 46 where a.object_name = v_pack 47 and a.object_type = 'PACKAGE BODY'; 48 if tmp.cnt = 0 then 49 h.sts_404_not_found; 50 pc.h; 51 src_b.link_proc; 52 x.p('
', 'There is no package named ' || v_pack); 53 x.o('
'); 61 else 62 src_b.link_proc; 63 x.p('', i.procedure_name); 66 end loop; 67 end if; 68 end; 69 70 procedure call_external is 71 begin 72 if mod(to_char(sysdate, 'ss'), 2) = 1 then 73 h.sts_503_service_unavailable; 74 pc.h; 75 src_b.link_proc; 76 x.p('
', 'This page call a external service that''s unavailable for now.'); 77 else 78 pc.h; 79 src_b.link_proc; 80 x.p('
', 'Lucky, Call external service out of DB successfully.'); 81 end if; 82 x.p('
', 'If plsql call a out-of-db service, such as through db-link, external procedure, http,' || 83 ' that service may be unavailable, so return 503 service unavailable is ok.'); 84 end; 85 86 end error_b; 87 / Package body created. SQL> prompt SQL> prompt Creating package LONG_OPS_B Creating package LONG_OPS_B SQL> prompt ======================== ======================== SQL> prompt SQL> @@long_ops_b.prc SQL> create or replace procedure long_ops_b is 2 v_secs pls_integer := r.getn('sec', 10); 3 begin 4 for i in 1 .. v_secs loop 5 dbms_lock.sleep(1); 6 dbms_application_info.set_session_longops(tmp.i, 7 tmp.j, 8 op_name => r.url_full, 9 target_desc => 'sleep', 10 sofar => i, 11 totalwork => v_secs, 12 units => 'seconds'); 13 end loop; 14 x.p('
', 'over'); 15 end long_ops_b; 16 / Procedure created. SQL> SQL> prompt SQL> prompt Creating package CACHE_B Creating package CACHE_B SQL> prompt ======================== ======================== SQL> prompt SQL> @@cache_b.spc SQL> create or replace package cache_b is 2 3 procedure expires; 4 5 procedure last_modified; 6 7 procedure last_scn; 8 9 procedure etag_md5; 10 11 procedure report_by_hour; 12 13 end cache_b; 14 / Package created. SQL> prompt SQL> prompt Creating package body CACHE_B Creating package body CACHE_B SQL> prompt ============================= ============================= SQL> prompt SQL> @@cache_b.bdy SQL> create or replace package body cache_b is 2 3 procedure expires is 4 begin 5 h.expires(sysdate + 1); 6 cache.max_age(60); 7 cache.s_maxage(30); 8 cache.set_public; 9 --cache.no_cache; 10 cache.must_revalidate; 11 cache.proxy_revlidate; 12 pc.h; 13 src_b.link_proc; 14 x.p('
', 'Now is at ' || t.dt2s(sysdate) || '.'); 15 x.p('
', 'This page will expire a whole day later.'); 16 x.p('
', 17 'If your browser support expire cache model, when you click link to this page, the Now time will not change for the cached page.'); 18 x.p('
', 'Using expires will save network round trip, such improve proformance.'); 19 x.p('
', 'You can use special keys such as "F5", "Command-R" to force request to server for current version.'); 20 end; 21 22 procedure last_modified is 23 begin 24 cache.set_private; 25 cache.set_public; 26 cache.must_revalidate; 27 cache.max_age(10); 28 cache.s_maxage(20); 29 --cache.no_cache; 30 h.expires_as_maxage; 31 h.last_modified(trunc(sysdate)); 32 select max(a.last_ddl_time) into tmp.dt from user_objects a; 33 h.last_modified(tmp.dt); 34 h.check_if_not_modified_since; 35 --h.header_close; -- It's required to avoid executing the main code. 36 37 pc.h; 38 src_b.link_proc; 39 x.p('
', 'When this page is accessed, It may return 304 not modified for the entire day until mid-night.'); 40 x.p('
', 41 'But if you modified/compiled some of the schema objeccts, It will detect the change and return the current version'); 42 x.p('
', 43 'The last-modified-time will be max of the 00:00 in the morning or last-ddl-time of the schema objects.'); 44 x.p('
',
45 'You can call h.last_modified multiple times, then call h.header_close, ' || '
46 the last-modified header will be set the lasted date value of them, ' ||
47 'So if the page have many parts, you can call h.last_modified for each part''s last modified time.');
48 x.t('
');
49
50 for i in (select * from user_objects a where a.object_type != 'PACKAGE' order by a.last_ddl_time desc) loop
51 x.p('
', t.dt2s(i.last_ddl_time) || ' > ' || i.object_name); 52 end loop; 53 end; 54 55 procedure last_scn is 56 begin 57 h.expires_now; 58 cache.set_public; 59 select max(ora_rowscn) into tmp.scn from user_t a; 60 h.last_scn(tmp.scn); 61 h.check_if_none_match_scn; 62 --h.header_close; -- It's required to avoid executing the main code. 63 64 pc.h; 65 src_b.link_proc; 66 x.p('
', 'When this page is accessed, It may return 304 not modified for the entire day until mid-night.'); 67 x.p('
', 68 'But if you modified/compiled some of the schema objeccts, It will detect the change and return the current version'); 69 x.p('
', 70 'The last-modified-time will be max of the 00:00 in the morning or last-ddl-time of the schema objects.'); 71 x.p('
',
72 'You can call h.last_modified multiple times, then call h.header_close, ' || '
73 the last-modified header will be set the lasted date value of them, ' ||
74 'So if the page have many parts, you can call h.last_modified for each part''s last modified time.');
75 x.t('
');
76
77 for i in (select * from user_t a) loop
78 x.p('
', t.dt2s(i.ctime) || ' > ' || i.name); 79 end loop; 80 end; 81 82 procedure etag_md5 is 83 --v_charset varchar2(30) := nls_charset_name(nls_charset_id('CHAR_CS')); 84 begin 85 h.content_md5_on; 86 h.content_encoding_identity; 87 h.etag_md5_on; 88 cache.set_public; 89 pc.h; 90 src_b.link_proc; 91 x.p('
', to_char(nls_charset_id('CHAR_CS'))); 92 x.p('
', t.dt2s(i.last_ddl_time) || ' > ' || i.object_name); 101 end loop; 102 end; 103 104 procedure etag_manual is 105 begin 106 h.etag('md5value'); 107 end; 108 109 procedure report_by_hour is 110 v_date date := trunc(sysdate, 'hh'); 111 begin 112 h.last_modified(v_date); 113 h.expires_now; 114 h.header_close; 115 pc.h; 116 src_b.link_proc; 117 118 x.p('
', 119 'The user table report will update at start point of every hour. If you update the user table, the change can only see at the next hour.'); 120 x.p('
| @ | ', 'USERNAME,PASSWORD,CREATE TIME'))); 127 x.o('
|---|
| ', tmp.stv, ' | ')); 131 end loop; 132 x.c('
');
7 b.line('Link to test_b.d (basic request info) ');
8 b.line('Link to test_b.redirect (test for redirect)');
9 b.line('');
10 b.line(r.protocol);
11 b.line(r.client_addr);
12 b.line(r.client_port);
13 b.line(r.header('x-forwarded-proto'));
14 b.line(r.header('x-forwarded-for'));
15 b.line(r.header('x-forwarded-port'));
16 end;
17
18 procedure d is
19 begin
20 if r.getn('count', 0) = 404 then
21 h.sts_404_not_found;
22 h.header_close;
23 b.writeln('resource with count=404 does not exits');
24 g.cancel;
25 end if;
26
27 if r.getn('count', 0) = 403 then
28 h.sts_403_forbidden;
29 h.header_close;
30 b.writeln('You have not the right to access resource with count=403');
31 g.cancel;
32 end if;
33
34 -- h.allow_post;
35 -- h.allow('POST,PUT');
36 h.sts_200_ok;
37 h.content_type('text/html', charset => 'utf-8');
38 h.content_language('zh-cn');
39 h.set_cookie('bsid', 'myself', path => r.dir || 'test_b.d');
40
41 h.header('a', 1);
42 h.header_close;
43
44 pc.h;
45 x.o('');
48 x.p('', 'test case that none ascii charset following http header'); 49 x.p('
', r.hostname); 50 x.p('
', r.port); 51 x.p('
', r.method); 52 x.p('
', r.prog); 53 x.p('
', r.pack); 54 x.p('
', r.proc); 55 x.p('
', r.qstr);
56
57 b.line(' ', i);
68 end loop;
69 end;
70
71 procedure form is
72 begin
73 h.content_type(charset => 'gbk');
74 h.header_close;
75
76 b.line('Link to test_b.redirect');
77 b.line(' ', 'The pattern in package RC will use result cache function to get versioned rowtype data,');
31 x.p(' ', ' and set them in package variable and avoid requent reads on table.');
32 x.p(' ',
33 'This method will run well on both oracle 11.1 and 11.2, through they do differently for result cache dependency');
34 x.f('
');
58 b.line(r.header('accept-encoding'));
59 b.line('
');
60 -- b.line(to_char(r.lmt, 'yyyy-mm-dd hh24:mi:ss'));
61 b.line('
');
62 -- b.line(r.etag);
63 x.t('
');
64 x.a('', 'self', r.prog || r.qstr);
65
66 for i in 1 .. r.getn('count', 10) loop
67 x.p('');
12 x.p('
');
15 end;
16
17 -- 201 tip for the newly created file's URL
18 procedure do_201 is
19 begin
20 h.status_line(201);
21 h.location('@b.d');
22 h.header_close;
23 end;
24
25 -- 202 accept and processing, but not done completely
26 procedure do_202 is
27 begin
28 h.status_line(202);
29 h.header_close;
30 end;
31
32 -- 203 infomation is not sure or not complete
33 procedure do_203 is
34 begin
35 h.status_line(203);
36 h.header_close;
37 end;
38
39 -- 204 accept, but return null response
40 procedure do_204 is
41 begin
42 h.status_line(204);
43 h.header_close;
44 end;
45
46 -- 205 processed, but UA must
47 procedure do_205 is
48 begin
49 h.status_line(205);
50 h.header_close;
51 end;
52
53 -- 412 Precondition Failed
54 procedure do_412 is
55 begin
56 h.status_line(412);
57 h.header_close;
58 pc.h;
59 x.p('', 'status 412 Precondition Failed');
60 end;
61
62 procedure do_303 is
63 begin
64 h.status_line(303);
65 h.location('@b.d');
66 h.header_close;
67 end;
68
69 procedure do_303_retry_alfter is
70 begin
71 h.status_line(303);
72 h.location('@b.d');
73 --h.retry_after(10);
74 h.retry_after(sysdate + 10 / 24 / 60 / 60);
75 h.header_close;
76 end;
77
78 end test_c;
79 /
Package body created.
SQL>
SQL> -- download/upload, direct reqeust/response entity body ---
SQL>
SQL> prompt
SQL> prompt Creating package FILE_DL_B
Creating package FILE_DL_B
SQL> prompt ==========================
==========================
SQL> prompt
SQL> @@file_dl_b.spc
SQL> create or replace package file_dl_b is
2
3 procedure d;
4
5 procedure text;
6
7 procedure excel;
8
9 procedure word;
10
11 end file_dl_b;
12 /
Package created.
SQL> @@file_dl_b.bdy
SQL> create or replace package body file_dl_b is
2
3 procedure d is
4 begin
5 pc.h;
6 x.p('');
29 end if;
30 x.p('
');
9 src_b.link_pack(l('@c'));
10 src_b.link_proc(l('@c.register'));
11 x.t('
');
12 x.p('', 'There is the existing user list.');
13 x.o('
| @ | ', 'USERNAME,PASSWORD,CREATE TIME,OPERATION'))); 15 x.o('
|---|
| ', tmp.stv, ' | ')); 19 end loop; 20 x.c('
', 46 'When post form info, _c will check error and report 403 error message page directly, ' || 47 'If all is ok, _c can call h.go to redirect to a page such as go back, ' || 48 'If nothing is output and status=200(default) PSP.WEB will automatically redirect back, ' || 49 'If _c show some feedback info itself, PSP.WEB will redirect to the feedback url to prevent repeating valid post.'); 50 end; 51 52 procedure data_src is 53 cur sys_refcursor; 54 begin 55 h.content_type('text/resultsets'); 56 open cur for 57 select * from user_t where rownum <= 3; 58 rs.print('users', cur); 59 end; 60 61 end user_b; 62 / Package body created. SQL> @@user_c.bdy SQL> create or replace package body user_c is 2 3 procedure register is 4 v user_t%rowtype; 5 begin 6 v.name := r.getc('name'); 7 v.pass := r.getc('pass'); 8 v.ctime := sysdate; 9 10 e.report(v.name is null, 'User''s name is empty!'); 11 e.report(v.pass is null, 'User''s password is empty!'); 12 select count(*) into tmp.cnt from user_t a where a.name = v.name; 13 e.report(tmp.cnt = 1, 'Username ' || v.name || ' is existed already.'); 14 e.report(not regexp_like(v.name, '^[A-Za-z ]*$'), 'Username must composed of characters and space only.'); 15 16 insert into user_t a values v; 17 18 case r.getc('fb') 19 when 'N' then 20 return; 21 h.go('@b.register'); 22 when 'Y' then 23 pc.h; 24 src_b.link_proc; 25 x.p('
', t.ps('User ":1" is created with password set to ":2".', st(v.name, v.pass))); 26 x.p('
', 'Click ' || x.a('', 'here', 'javascript:history.back();') || ' to go back');
27 else
28 null; -- PSP.WEB will automatically redirect back if nothing is output and status=200
29 end case;
30 end;
31
32 procedure remove is
33 begin
34 h.allow_get;
35 delete from user_t a where a.name = r.getc('name');
36 --h.redirect(r.referer);
37 --g.alert_back('use deleted successfully');
38 --g.alert_go('use deleted successfully', 'ora_good_b.entry');
39 end;
40
41 end user_c;
42 /
Package body created.
SQL> @@auth_s.bdy
SQL> create or replace package body auth_s is
2
3 procedure login_simple(p_name varchar2) is
4 begin
5 r.setc('s$username', p_name);
6 r.setc('s$uid', p_name);
7 end;
8
9 procedure login_complex(p_name varchar2) is
10 begin
11 r.setc('s$company', r.getc('company'));
12 r.setc('s$username', p_name);
13 r.setc('s$method', 'password');
14 r.setd('s$ltime', sysdate);
15 r.setn('s$maxidle', r.getn('maxidle'));
16 r.setn('s$maxlive', r.getn('maxlive'));
17 r.setc('s$attr1', r.getc('attr1'));
18 r.setc('s$attr2', r.getc('attr2'));
19 r.setc('s$gid', r.getc('company'));
20 r.setc('s$uid', p_name);
21 end;
22
23 function user_name return varchar2 is
24 begin
25 return r.getc('s$username');
26 end;
27
28 function login_time return date is
29 begin
30 return r.getd('s$ltime');
31 end;
32
33 procedure logout is
34 begin
35 if not r.is_null('s$IDLE') then
36 r.setc('s$BSID', '');
37 end if;
38 end;
39
40 end auth_s;
41 /
Package body created.
SQL> @@profile_s.bdy
SQL> create or replace package body profile_s is
2
3 procedure set_scheme(name varchar2) is
4 begin
5 r.setc('s$pf.scheme', name);
6 end;
7
8 function get_scheme return varchar2 is
9 begin
10 return r.getc('s$pf.scheme');
11 end;
12
13 procedure set_rows_per_page(rows number) is
14 begin
15 r.setn('s$pf.rows', rows);
16 end;
17
18 function get_rows_per_page return number is
19 begin
20 return r.getn('s$pf.rows');
21 end;
22
23 end profile_s;
24 /
Package body created.
SQL> @@auth_b.bdy
SQL> create or replace package body auth_b is
2
3 procedure basic is
4 v_user varchar2(30) := 'psp.web';
5 v_pass varchar2(30) := 'best';
6 begin
7 if (r.user is null or r.user != v_user) and (r.pass is null or r.pass != v_pass) then
8 h.www_authenticate_basic('test');
9 pc.h;
10 x.p(' ', 'Username should be ' || v_user || ' to pass');
11 x.p(' ', 'Password should be ' || v_pass || ' to pass');
12 return;
13 end if;
14 pc.h;
15 src_b.link_proc;
16 x.p(' ', 'Hello ' || r.user || ', Welcome to access this page.');
17 x.p(' ', 'You have passed the http basic authentication.');
18 end;
19
20 procedure digest is
21 begin
22 h.sts_501_not_implemented;
23 pc.h;
24 src_b.link_proc;
25 x.p(' ', 'PSP.WEB have not implemented http digest authentication by now.');
26 end;
27
28 procedure cookie_gac is
29 v_sid varchar2(100);
30 begin
31 if r.is_null('s$IDLE') then
32 if r.bsid is null then
33 v_sid := t.gen_token;
34 h.set_cookie('PHPSESSID', v_sid, path => r.dir);
35 else
36 v_sid := r.bsid;
37 end if;
38 r.setc('s$BSID', v_sid);
39 end if;
40
41 pc.h;
42 src_b.link_proc;
43 x.t(' ',
47 t.ps('You are :1, You have already logged ( at :2 ) in.', st(auth_s.user_name, t.dt2s(auth_s.login_time))));
48 x.a('', 'Logout', '@b.logout');
49 else
50 x.p(' ', 'You are anonymous.');
51 end if;
52
53 x.p(' ', 'Please fill your name and password to log in.');
54 x.f(' ', 'Welcome ' || auth_s.user_name || ', you have logged in successfully.');
118 x.a('', 'relogin', '@b.cookie_gac');
119 end;
120
121 procedure logout is
122 begin
123 auth_s.logout;
124 h.go('@b.cookie_gac');
125 end;
126
127 procedure check_maxidle is
128 begin
129 if r.getn('s$IDLE') > r.getn('s$maxidle') * 1000 then
130 pc.h;
131 x.p(' ',
132 'You logged in session is timeout for idle more than ' || r.getn('s$maxidle') || 's, session is removed.');
133 x.p(' ', 'last access time : ' || to_char(r.lat, 'hh24:mi:ss'));
134 x.p(' ', 'last access time : ' || to_char(sysdate - r.getn('s$IDLE') / 1000 / 24 / 60 / 60, 'hh24:mi:ss'));
135 x.p(' ', 'current time : ' || to_char(sysdate, 'hh24:mi:ss'));
136 x.p(' ', 'idle time : ' || to_char(r.getn('s$IDLE')));
137 x.p(' ', 'idle time : ' || (sysdate - r.lat) * 24 * 60 * 60 * 1000);
138 x.p(' ', 'max idle threshold : ' || r.getn('s$maxidle') || ' seconds');
139 auth_s.logout;
140 g.cancel;
141 end if;
142 end;
143
144 procedure check_maxlive is
145 begin
146 if auth_s.login_time + r.getn('s$maxlive') / 24 / 60 / 60 < sysdate then
147 pc.h;
148 x.p(' ', 'You logged in session lived for too long, that is more than 1 minute, session is removed.');
149 x.p(' ', 'login time : ' || to_char(auth_s.login_time, 'hh24:mi:ss'));
150 x.p(' ', 'current time : ' || to_char(sysdate, 'hh24:mi:ss'));
151 x.p(' ', 'max live threshold : ' || r.getn('s$maxlive') || ' seconds');
152 auth_s.logout;
153 g.cancel;
154 end if;
155 end;
156
157 procedure check_update is
158 begin
159 check_maxidle;
160 check_maxlive;
161 end;
162
163 procedure protected_page is
164 begin
165 pc.h;
166 if auth_s.user_name is null then
167 h.sts_403_forbidden;
168 x.p(' ', 'You have not logged in.');
169 x.a('', 'login now', '@b.cookie_gac');
170 return;
171 end if;
172
173 src_b.link_proc;
174 x.t(' ', 'This page show how to deal with login/logout fair, instead of using k_filter.before.');
176 x.p(' ',
177 t.ps('You are :1 at :2, You have are logged in at :4 with method(:3).',
178 st(auth_s.user_name, r.getc('s$company'), r.getc('s$method'), t.dt2s(auth_s.login_time))));
179 x.p(' ', 'login time : ' || t.dt2s(auth_s.login_time));
180 x.p(' ', 'login time : ' || r.getc('s$ltime'));
181 x.p(' ', 'some example session attribute include');
182 x.p(' ', 'attr1 = ' || r.getc('s$attr1'));
183 x.p(' ', 'attr2 = ' || r.getc('s$attr2'));
184 x.p(' ', 'scheme = ' || profile_s.get_scheme);
185 x.p(' ', 'rows per page = ' || profile_s.get_rows_per_page);
186 x.a('', 'relogin', '@b.cookie_gac');
187
188 x.t(' ', 'using result cache for user_t, we got the rowtype info');
192 x.p(' ', 'result cache ' || t.tf(rcpv.user_hit, 'hit', 'miss'));
193 x.p(' ', 'username=' || rcpv.user_row.name);
194 x.p(' ', 'password=' || rcpv.user_row.pass);
195 x.p(' ', 'crt_time=' || t.dt2s(rcpv.user_row.ctime));
196 exception
197 when no_data_found /*s.over_max_idle*/
198 then
199 h.sts_403_forbidden;
200 x.p(' ', t.ps('You are :1, You last access time is ( at :2 ) in.', st(auth_s.user_name, t.dt2s(r.lat))));
201 x.p(' ', 'But this system allow only 60 seconds of idle time, then it will timeout the session.');
202 x.a('', 'relogin now', '@b.cookie_gac');
203 when others /*s.over_max_keep*/
204 then
205 h.sts_403_forbidden;
206 x.p(' ',
207 t.ps('You are :1, You have already logged ( at :2 ) in.', st(auth_s.user_name, t.dt2s(auth_s.login_time))));
208 x.p(' ', 'But this system allow only 10 minute use after successful login.');
209 x.a('', 'relogin now', '@b.cookie_gac');
210 end;
211
212 procedure basic_and_cookie is
213 v_user varchar2(30) := 'psp.web';
214 v_pass varchar2(30) := 'best';
215 v user_t%rowtype;
216 begin
217 if auth_s.user_name is not null then
218 null;
219 k_debug.trace('user in login sts');
220 elsif r.user is null and r.pass is null then
221 k_debug.trace('no user/pass');
222 h.www_authenticate_basic('test');
223 pc.h;
224 x.p(' ', 'You should login first');
225 x.p('');
52 x.t('');
71 end if;
72
73 end;
74 end local_css_b;
75 /
Package body created.
SQL>
SQL> prompt
SQL> prompt Creating package X_TAG_B
Creating package X_TAG_B
SQL> prompt ==========================
==========================
SQL> prompt
SQL> @@list_b.spc
SQL> create or replace package list_b is
2
3 procedure user_objects;
4
5 procedure user_objects_cur;
6
7 procedure user_procedures;
8
9 end list_b;
10 /
Package created.
SQL> @@list_b.bdy
SQL> create or replace package body list_b is
2
3 procedure user_objects is
4 cursor c is
5 select *
6 from user_objects a
7 where a.object_name not like 'BIN$%'
8 and a.object_type not like '%PARTITION'
9 and rownum <= 3
10 order by a.object_type, a.object_name;
11 begin
12 x.p('');
42 end;
43
44 procedure tree_css2 is
45 begin
46 x.l('', '[bootstrap.css]');
47 x.j('');
113
114 end;
115
116 procedure parse_render_in_loop is
117 cursor c is
118 select e.*,
119 level as lvl,
120 connect_by_isleaf as is_leaf,
121 sys_connect_by_path(last_name, '/') as path,
122 connect_by_root last_name as manager
123 from employees e
124 start with e.manager_id = (select a.employee_id from employees a where a.manager_id is null)
125 connect by prior e.employee_id = e.manager_id
126 order siblings by e.last_name asc;
127 begin
128 src_b.header;
129 tree_css2;
130 x.o(' ', 'Building the first list');
11 obj := json_list(); --an empty structure
12 obj.append('a little string');
13 obj.append(123456789);
14 obj.append(true);
15 obj.append(false);
16 obj.append(json_value);
17 x.p(' ', obj.to_char);
18 x.p(' ', 'add with position ');
19 obj.append('Wow thats great!', 5);
20 x.p(' ', obj.to_char);
21 x.p(' ', 'remove with position');
22 obj.remove(4);
23 x.p(' ', obj.to_char);
24 x.p(' ', 'remove first');
25 obj.remove_first;
26 x.p(' ', obj.to_char);
27 x.p(' ', 'remove last');
28 obj.remove_last;
29 x.p(' ', obj.to_char);
30 x.p(' ', 'you can display the size of an list');
31 x.p(' ', obj.count);
32 x.p(' ', 'you can also add json or json_lists as values:');
33 obj := json_list(); --fresh list;
34 obj.append(json('{"lazy construction": true}').to_json_value);
35 obj.append(json_list('[1,2,3,4,5]'));
36 x.p(' ', obj.to_char);
37 x.p(' ', 'however notice that we had to use the "to_json_value" function on the json object');
38
39 for i in (select * from team_t a) loop
40 o := json(); --an empty structure
41 o.put('tid', i.tid);
42 o.put('tname', i.tname);
43 o.put('cdate', json_ext.to_json_value(i.cdate));
44 l.append(o.to_json_value);
45 end loop;
46 -- l := json_dyn.executeList('select * from team_t a');
47 p.script_open;
48 b.line('var teams =');
49 b.line(l.to_char);
50 b.line(';
51 for(i=0;i ' || str || ' ', 'main content here');
69 x.p(' ', 'component html content printed in head as script(type=text)');
70 x.p(' ', 'use js to fill the component content into anchar tags');
71 x.p(' ', 'reorder parts of page in client is easy');
72 x.p(' ', 'so noradle does''t support reorder at server side');
73 x.t('
');
44
45 if auth_s.user_name is not null then
46 x.p('
');
175 x.p('
');
189 src_b.link_proc('rc.set_user_info');
190 rc.set_user_info(auth_s.user_name);
191 x.p('', 'use tree.p, tree.o, tree,r, tree.c to print tree');
132
133 x.o('
', 'use tree.rc(sys_refcursor) to print tree');
159 open cur for
160 select level as lvl, e.phone_number, e.first_name, e.last_name
161 from employees e
162 start with e.manager_id = (select a.employee_id from employees a where a.manager_id is null)
163 connect by prior e.employee_id = e.manager_id
164 order siblings by e.last_name asc;
165 x.o('
', 'use tree.prc(sys_refcursor) to print tree in one step');
189 open cur for
190 select level as lvl, e.phone_number, e.first_name, e.last_name
191 from employees e
192 start with e.manager_id = (select a.employee_id from employees a where a.manager_id is null)
193 connect by prior e.employee_id = e.manager_id
194 order siblings by e.last_name asc;
195 x.o('
', 'use tree.p, tree.o, tree,r, tree.n(by level), tree.c to print tree');
216 x.o('
', 'use tree.p, tree.o, tree.n(all types), tree.c to print tree');
245 x.o('
');
246 tr.o(true);
247
248 tr.n(1, '
');
290 end;
291
292 end tree_b;
293 /
Package body created.
SQL>
SQL> prompt css framework integration demos
css framework integration demos
SQL>
SQL> prompt
SQL> prompt Creating package BOOTSTRAP_B
Creating package BOOTSTRAP_B
SQL> prompt ==========================
==========================
SQL> prompt
SQL> @@bootstrap_b.spc
SQL> create or replace package bootstrap_b is
2
3 procedure packages;
4
5 procedure show_code;
6
7 procedure tables;
8
9 procedure images;
10
11 end bootstrap_b;
12 /
Package created.
SQL> @@bootstrap_b.bdy
SQL> create or replace package body bootstrap_b is
2
3 -- public
4 procedure use_lib is
5 begin
6 b.l('');
7 o.t('');
8 o.t(' ');
9 o.t(' ');
10 o.u(' ', '[bootstrap.css]');
11 o.u(' ');
54 end;
55
56 procedure handsontable is
57 cur sys_refcursor;
58 begin
59 if r.is_xhr then
60 open cur for
61 select rowid rid, a.* from countries a;
62 rs.print(cur);
63 return;
64 end if;
65 src_b.header;
66 o.u('');
87 end;
88
89 procedure datatables is
90 begin
91 src_b.header;
92 o.u('', '[bootstrap.css]');
93 o.u('');
120 end;
121
122 end tables_h;
123 /
Warning: Package Body created with compilation errors.
SQL> @@icon_b.spc
SQL> create or replace package icon_b is
2
3 procedure material_design_icons;
4
5 procedure bootstrap_material_design;
6
7 procedure ionicons;
8
9 end icon_b;
10 /
Package created.
SQL> @@icon_b.bdy
SQL> create or replace package body icon_b is
2
3 procedure material_design_icons is
4 begin
5 src_b.header;
6 o.u('', '[bcdn]material-design-icons/2.0.0/iconfont/style.min.css');
7 o.t('
');
22
23 v := dbms_xmlgen.newcontext('select t.name as "td",t.pass as "td" from user_t t');
24 dbms_xmlgen.setrowsettag(v, 'table');
25 dbms_xmlgen.setrowtag(v, 'tr');
26
27 show_begin;
28 b.write(dbms_xmlgen.getxmltype(v).getclobval());
29 show_end;
30 end;
31
32 procedure xmlgen_cur is
33 c sys_refcursor;
34 v dbms_xmlgen.ctxhandle;
35 begin
36 pc.h;
37 src_b.link_proc;
38 x.t('
');
39
40 open c for
41 select * from user_t;
42 v := dbms_xmlgen.newcontext(c);
43 dbms_xmlgen.setrowsettag(v, 'users');
44 dbms_xmlgen.setrowtag(v, 'user');
45
46 show_begin;
47 b.write(dbms_xmlgen.getxmltype(v).getclobval());
48 show_end;
49 close c;
50 end;
51
52 procedure xmlgen_hier is
53 c sys_refcursor;
54 v dbms_xmlgen.ctxhandle;
55 begin
56 pc.h;
57 src_b.link_proc;
58 x.t('
');
59 open c for
60 select o.object_name as "name",
61 cursor (select p.procedure_name as "name" from user_procedures p where p.object_name = o.object_name) "procedures"
62 from user_objects o
63 where o.object_type = 'PACKAGE';
64 v := dbms_xmlgen.newcontext(c);
65 dbms_xmlgen.setrowsettag(v, 'packages');
66 dbms_xmlgen.setrowtag(v, 'package');
67 -- dbms_xmlgen.setmaxrows(v, 1);
68 show_begin;
69 b.write(dbms_xmlgen.getxmltype(v).getclobval());
70 show_end;
71 close c;
72 end;
73
74 procedure sql_users is
75 v_table xmltype;
76 begin
77 x.o('');
78 x.o('');
79 x.l(' ', 'user_table.css');
80 x.c('');
81 x.o('');
82 src_b.link_proc;
83 x.t('
');
84
85 select xmlelement("table",
86 xmlattributes('all' as "rules"),
87 chr(10),
88 xmlagg(xmlelement("tr",
89 xmlattributes('black' as "class", 90 as "height", 'green' as "color"),
90 chr(10),
91 xmlforest(t.name as "td", t.pass as "td", (t.ctime) as "td"),
92 chr(10))))
93 into v_table
94 from user_t t
95 order by t.ctime asc;
96 b.write(v_table.getclobval);
97 end;
98
99 procedure xml_users_css is
100 c sys_refcursor;
101 v dbms_xmlgen.ctxhandle;
102 begin
103 h.content_type('text/xml');
104
105 open c for
106 select * from user_t;
107 v := dbms_xmlgen.newcontext(c);
108 dbms_xmlgen.setrowsettag(v, 'users');
109 dbms_xmlgen.setrowtag(v, 'user');
110 x.t('', st(l('@b/users_ol.css')));
111 b.write(dbms_xmlgen.getxmltype(v).getclobval);
112 close c;
113 end;
114
115 procedure xml_users_xsl_cli is
116 c sys_refcursor;
117 v dbms_xmlgen.ctxhandle;
118 v_url varchar2(500);
119 begin
120 h.content_type('text/xml');
121
122 open c for
123 select * from user_t;
124 v := dbms_xmlgen.newcontext(c);
125 dbms_xmlgen.setrowsettag(v, 'users');
126 dbms_xmlgen.setrowtag(v, 'user');
127 b.line('');
128 x.t('', st(l('@b/users.xsl')));
129 b.write(dbms_xmlgen.getxmltype(v).getclobval());
130 close c;
131 end;
132
133 -- has problem by now
134 procedure xml_users_xsl_svr is
135 c sys_refcursor;
136 v dbms_xmlgen.ctxhandle;
137 v_bfile bfile;
138 v_xml xmltype;
139 v_xsl xmltype;
140 v_str varchar2(4000);
141 v_xhtml xmltype;
142 begin
143 src_b.link_proc;
144 x.t('
');
145
146 open c for
147 select * from user_t;
148 v := dbms_xmlgen.newcontext(c);
149 dbms_xmlgen.setrowsettag(v, 'users');
150 dbms_xmlgen.setrowtag(v, 'user');
151 v_xml := dbms_xmlgen.getxmltype(v);
152 close c;
153
154 tmp.s := '/demo/packs/xml_page_b/users.xsl';
155 v_bfile := bfilename('PSPDADS', tmp.s);
156 if dbms_lob.fileexists(v_bfile) = 0 then
157 raise_application_error(-20001, 'xslt file not exists');
158 end if;
159 v_xsl := xmltype(v_bfile, 0);
160
161 h.header_close;
162 v_xhtml := v_xml.transform(v_xsl);
163 b.write(v_xhtml.getclobval());
164 end;
165
166 end xml_page_b;
167 /
Package body created.
SQL>
SQL> prompt
SQL> prompt Creating package JSON_B
Creating package JSON_B
SQL> prompt ===========================
===========================
SQL> prompt
SQL> @@json_b.spc
SQL> create or replace package json_b is
2
3 procedure t1;
4
5 end json_b;
6 /
Package created.
SQL> @@json_b.bdy
SQL> create or replace package body json_b is
2
3 procedure t1 is
4 obj json_list;
5 l json_list := json_list();
6 o json;
7 begin
8 -- p.doc_type('text');
9 pc.h;
10 x.p('' || str || '
';
6 end;
7
8 end;
9 /
Type body created.
SQL> whenever sqlerror exit
SQL> @@user_type_b.spc
SQL> create or replace package user_type_b is
2
3 procedure basic;
4
5 end user_type_b;
6 /
Package created.
SQL> @@user_type_b.bdy
SQL> create or replace package body user_type_b is
2
3 procedure basic is
4 v tool := tool('.');
5 begin
6 if r.getc('type', '') = '2' then
7 v := tool2('.');
8 else
9 v := tool('.');
10 end if;
11 b.write(v.wrap('hello world'));
12 end;
13
14 end user_type_b;
15 /
Package body created.
SQL>
SQL> prompt reuse js/css resource in container page, reduce repeated load of same url
reuse js/css resource in container page, reduce repeated load of same url
SQL> @@po_ajaxload_b.spc
SQL> create or replace package po_ajaxload_b is
2
3 procedure main;
4
5 end po_ajaxload_b;
6 /
Package created.
SQL> @@po_ajaxload_b.bdy
SQL> create or replace package body po_ajaxload_b is
2
3 procedure main is
4 begin
5 x.t('
');
68 x.p('
');
74 x.p('