Code and data can alternate: if expression begins
DBMS execute the following after getting of input data:
enter into DBMS | DDL | entered |
<formdata> <x data1="Larry" data2="oid_in_traffic"> </formdata> |
create table formdata ( id num primary key, sal varchar, san num4, sp num2, ral varchar, ran num4, rp num2, ru varchar, rs varchar, g varchar, su varchar ); create table x ( id num primary key, srv num references formdata, data1 varchar, data2 blob ); |
insert into formdata values (1, asker.org, 111.111.111.111, 80, distination.org, 222.222.222.222, 80, tomson, car-celler, BrowserName ); insert into x values (10, 1, Larry, file_content); |
Success of writing of xml-trees into database depends of, is scheme of database corresponds to entering tree (some xml-sub-trees are ignored at discrepancy).
If enclosed table refers by two own fields to two different records of embracing table, then it' necessary to specify name of corresponding field of embracing table in opening tag of enclosed table after its name through sign slash "/".
If embracing table refers by two own fields to two different records of enclosed table, then it' necessary to specify name of corresponding field of enclosed table in opening tag of embracing table after its name through sign slash "/".
Thus table and its refering field are specified through slash in one opening tag. We shall name such specification of field in opening tag as determination (it's also provided browser). Different variants of determination are considered in separate document. It's supposed in example below, that all primary keys have sequences, values from which are entered into these keys by default.
enter into DBMS | DDL | entered |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, data float ); create table b ( id num primary key, ref num references a(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 12.3); insert into b values (101, 10, 23.4); insert into b values (102, 10, 34.5); insert into b values (103, 10, 45.6); -- section "b" is set |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, data float ); create table b ( id num primary key, ref1 num references a(id), ref2 num references a(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 12.3); |
<formdata> <a data=12.3> <b/ref1 data=23.4> <b/ref1 data=34.5> <b/ref1 data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, data float ); create table b ( id num primary key, ref1 num references a(id), ref2 num references a(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 12.3); insert into b values (101, 10, null, 23.4); insert into b values (102, 10, null, 34.5); insert into b values (103, 10, null, 45.6); |
<formdata> <a data=12.3> <b data=23.4> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, 100, 12.3); insert into b values (100, 23.4); -- section "b" is relay-race |
<formdata> <a data=12.3> <b data=23.4> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref1 num references b(id), ref2 num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, null, null, 12.3); |
<formdata> <a/ref1 data=12.3> <b data=23.4> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref1 num references b(id), ref2 num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, 100, null, 12.3); insert into b values (100, 23.4); |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, null, 12.3); -- section "b" is not entered (all tags together!), -- because scheme of database contain -- no set and no list for it |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref num references b(id), data float ); create table b ( id num primary key, ref num references b(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 101, 12.3); insert into b values (101, 102, 23.4); insert into b values (102, 103, 34.5); insert into b values (103, null, 45.6); -- section "b" is list |