Posts tagged query
On a recent project, I ran into a problem with an XML document, that had to be enclosed within another XML document, generated from a database query. The problem I ran into was the character encoding of the XMLElement function, which eventually was worked around with UPDATEXML.
In this blog post I would like to share with you several attempts to solve this problem, why they failed and the final solution to the problem.
Printing of official documents happened in a separate printing module. Whenever a document needed to be printed, an XML document was generated in a database query and sent to the printing module. Most of the data came from relational database tables, but pieces of standard text were supplied as XML documents by another party… and saved in our database in an XMLType column based on CLOB storage.
Our printing module expected to find these standard text XML documents within a tag in our generated XML document. Also both XML documents, our generated XML and the supplied XML, had different namespaces, this needed to maintained this way. The Oracle database version we were working with was 10.1.0.5.0.
In this post I will use a simplified version of the real XML More >
RESTful service based on ADF Business Components, publishing enterprise database contents the REST way
After three introductory and exploratory articles on RestLet, RESTful Services and the creation of the latter using the former in JDeveloper 11g as well as hooking it up with ADF, it is now time to create a more serious RESTful service. A service that exposes resources from an enterprise business service. One backed by a enterprise database. One that RESTfully provides access to the Human Resource data. In other words: we will publish RESTful services for DEPT and EMP in the SCOTT schema.
It really is simple. The steps are:
- create default ADF BC business objects for the DEPT and EMP tables; this implicitly publishes a Data Control that exposes the data collections
- create a new JSF page; drag the EMP table to this page and drop it as master-detail (table-table); this implicitly creates a PageDefinition that fuels the BindingContainer we need for our services
- create and configure a servlet filter that will take care of initializing the BindingContainer on every request
- create Resource classes for Depts, Dept, Emps and Emp; these classes get the appropriate data binding from the BindingContainer, set the current row for Dept (all resources except Depts) and Emp (only for the Emp More >
All the tell tale signs are there: nervous Oracle staff – looking around them to check out whether no one can read their minds, some intriguing but very unspecific rumors, quiet anticipation building like a low rumble in the distance that preceeds a hurricane, the series of Thursday sessions on one new topic that seems to appear out of thin air – and is not mentioned in the sessions prior to Thursday… The conclusion seems unavoidable: on Wednesday, Larry E. will make a big (let’s make that BIG) announcement regarding the database. One that will shock the industry. And until Wednesday: all lips are sealed.
(apparently, some months ago, Larry Ellison said to analysts: "We are not going to sit on our laurels; we have a major database innovation that we will announce in September of this year. It is going to be a very big and important announcement for us so we are not standing still in database." (see: http://kevinclosson.wordpress.com/2008/06/26/of-gag-orders-excitement-and-new-products/ )
From looking at the conference program, a second conclusion pushes itself to the front: Thursday has at least four sessions on a topic that is not presented on earlier in the week. And that seems More >
Not all has to be black and white in SQL Queries: returning match scores instead of only perfect fits
Recently I sat in on a very interesting presentation on an advanced search and matching engine called Elise. The power of this engine lies in the fact that it does not just query records, returning the set of records that satisfy the search criteria – although it has some pretty advanced search filters and operators, but is able to score all records according to the match criteria. Every record gets a score – which can be zero, meaning that not a single search criteria matched even the smallest way. Higher scores mean better matches on more, or on the most important, criteria.
Many search operations do not necessarily need perfect matches. They need possibly multiple results that are all matches to a certain degree. Google for example returns web pages that meet your search criteria to a certain degree. The most relevant matches are at the top of the search results – or at least that is the intention. Searching for interesting job vacancies, holiday destinations, new real estate, electronic devices, dating partners on a e-dating site, books on Oracle technology are other examples of searches that look for best matches given criteria, not necessarily perfects fits for all criteria More >