List of articles   Terminology   Choose language


Abbreviated syntax for 'from' and 'where'


In cases, when fields of two tables are bound by foreign key, and user enters identical meanings into bound fields during filling database, possibility appears to use XPath for reduction of bulky expressions, for example

с XPath без XPath
where a/b/c/d/@d3=k/l/m/n/@n2;
where a.uk=b.fk and
      b.uk=c.fk and
      c.uk=d.fk
and
      k.uk=l.fk and
      l.uk=m.fk and
      m.uk=n.fk
and
      d.d3=n.n2;
I propose to allow usage of XPath also after service words 'select' and 'from', because request on the left in pair below looks much better, than request on the right.
select d/e/f/@f3
from   a/b/c
where  p/q/r/@r2=5;
select f3
from   a/b/c/d/e/f
where  ../../../p/q/r/@r2=5;
And also after service words 'insert, update, delete'
insert into d/e/f/tab (fld)
values (5);
insert into a/b/c/@c1/d/e/f (fld)
values (5);
insert into a/b/c/@c1/d/e/tab
values ('<tag>...</tag>');
update d/e/f/tab
set @fld=5;
update d/e/f/tab
set @fld/p/q/r/@r1=5;
update a/b/c/@c1/d/e/f
set @fld=5;
delete from a/b/c/n;


Dmitry Turin



List of articles   Terminology   Choose language