|
|
1.49 paf 1: @main[]
1.48 paf 2: ^connect[oracle://mts_imprimatur2:imp2@mts]{
1.49 paf 3: # ^in[]
1.50 paf 4: # ^out[]
1.51 ! paf 5: # ^inout[]
! 6: # ^ex[]
! 7: # ^ex2[]
! 8: # ^ex3[]
! 9: ^ex4[]
1.49 paf 10: OK
11: }
12:
13: @inp[]
1.50 paf 14: create table pif(a integer);
1.49 paf 15: create or replace procedure paf(a in integer) as begin
16: insert into pif (a) values (:a);
17: end;
18: /
19:
20: @in[]
1.48 paf 21: # ^void:sql{create table paf(a clob)}
22: # ^void:sql{insert into paf (a) values (/**a**/'a')}
23: # ^void:sql{insert into paf (a) values (:unk)}
24: ^void:sql{delete from pif}
25: ^void:sql{call paf(:a)}[
26: $.bind[
27: $.a[2]
28: ]
29: ]
30: ^int:sql{select count(*) from pif}
31: "^string:sql{select a from pif}"
32:
33: # ^string:sql{select a from paf}
1.49 paf 34:
35: @outp[]
36: create or replace procedure pafm(ai in integer,ao out integer) as begin
37: ao:=ai;
38: end;
39: /
40: @out[]
41: $vars[
42: $.ai(2222)
43: $.ao[sad]
44: ]
45: ^void:sql{call pafm(:ai,:ao)}[
46: $.bind[$vars]
47: ]
48: "$vars.ai"
49: "$vars.ao"
1.50 paf 50:
51: # ^string:sql{select a from paf}
52:
53: @inoutp[]
54: create or replace procedure pafio(aio in out integer) as begin
55: aio:=aio*2;
56: end;
57: /
58: @inout[]
59: $vars[
60: $.aio(2222)
61: ]
62: before "$vars.aio"<br>
63: ^void:sql{call pafio(:aio)}[
64: $.bind[$vars]
65: ]
66: after "$vars.aio"
1.49 paf 67:
68: # ^string:sql{select a from paf}
1.51 ! paf 69:
! 70: @exp[]
! 71: create or replace procedure pafex is
! 72: begin
! 73: DECLARE
! 74: out_of_stock EXCEPTION;
! 75: begin
! 76: raise out_of_stock;
! 77: end;
! 78: end;
! 79: /
! 80: @ex[]
! 81: ^void:sql{
! 82: begin
! 83: pafex^;
! 84: end^;
! 85: }
! 86: @ex[]
! 87: ^void:sql{call pafex()}
! 88:
! 89: @exp2[]
! 90: create or replace procedure pafex2 is
! 91: begin
! 92: raise ZERO_DIVIDE;
! 93: end;
! 94: /
! 95: @ex2[]
! 96: ^void:sql{call pafex2()}
! 97:
! 98:
! 99: @exp3[]
! 100: create or replace procedure pafex3 is
! 101: begin
! 102: DECLARE
! 103: out_of_stock EXCEPTION;
! 104: PRAGMA EXCEPTION_INIT(out_of_stock, -333);
! 105: begin
! 106: raise out_of_stock;
! 107: end;
! 108: end;
! 109: /
! 110: @ex3[]
! 111: ^void:sql{call pafex3()}
! 112:
! 113:
! 114: @exp4[]
! 115: create or replace procedure pafex4 is
! 116: begin
! 117: raise_application_error(-20444, 'Salary is missing');
! 118: end;
! 119: /
! 120: @ex4[]
! 121: ^void:sql{call pafex4()}
! 122:
! 123: