Convenient Reference

esProc is more intuitive and easier than SQL to solve complex calculations with multi-table join. With “.” for generic object reference in esProc, this expression is more straightforward and easy to understand, allowing users to easily organize the relationship between data from business perspective.

esProc reference function tranforms complex & lengthy statement of multi-table join into simple object access, which SQL cannot achieve. When the table number grows, the complexity of SQL relational query will come into a geometric growth; While with object reference of esProc, you will always have intuitive and easy access to data.

Dissociative record objects

  • The dissociative record refers to the records free from the physical table in form. The analyst can take the individual record as an object to fetch value, compute, and modify, just similar to the access to an object.
  • The dissociative record enables the analyst to focus on the concerned data and save them from the interference, so that the faster and more convenient data computation can be achieved.
  • The dissociative record is the embodiment of stepwise computation. For SQL, the feature of dissociative record is unavailable.
A
1 =db.query(“select * from Employee”)
2
=A1.sort(EntryDate)
3
=A2(1)
The first on-boarding employee
4 =A3.Birthday Birthday of the first on-boarding employee
5
=A2(2).Name
The second on-boarding employee
6
=A1.minp(Birthday)
The eldest employee
7 =A6.EntryDate On-boarding date of the eldest employee
8
=A2(to(3))|A6
The first 3 on-boarding employees and the eldest employee
9 =A8.avg(Salary) The average salary of the employees in the above set
Records reference in field value

  • In esProc, field value can not only be used to store the simple number and character string, but also point to the complex data type like record. This kind of field is usually called Foreign Key.
  • In esProc, you can directly use ”.” symbol to reference the record to which the foreign key is pointing.
  • In the below example, there are 4 records in A6. Of which the foreign key Dept is pointing to the records of Department table. If accessing to the Manager ID related to Dept, then you can just compose A6.Dept.Manager.
  • The object reference makes the access to foreign key a very simple thing. The business team can thus analyze and solve problems from the business perspective rapidly and intuitively.
  • The advantages of esProc are prominent when encountering the multi-nest foreign keys. Because SQL does not support the object reference, it is very complicated to represent the multi-nest foreign key association.
A
1 =db.query(“select * from Employee”)
2 =db.query(“select * from Department”)
3
>A1.run(Dept=A2.select@1(Dept==A1.Dept))
The fields are assigned with values of references to other table records
4
>A2.run(Manager=A1.select@1(ID==A2.Manager))
5
=A1.new(Name,Dept.Dept:Dept,Dept.Manager.Name:Manager)
Access the fields of referenced records
6
=A1.select(Dept.Manager.Gender==”Female”)