March 21, 2010  
Register   Login  
Forum  
 
  Forum  Enesys RS Data ...  Suggestions  Feedback needed for possible SQL Query feature
Previous Previous
 
Next Next
New Post 2/12/2008 12:51 PM
  Frédéric LATOUR
550 posts
1st Level Poster


Feedback needed for possible SQL Query feature 
Modified By Frédéric LATOUR  on 2/12/2008 3:11:52 PM)

We would like to share with you some options for future versions of Enesys RS Data Extension and get your feedback before deciding  to include them in the coming versions.

SQL Query language

Enesys RS Data Extension query syntax currently provides some SQL-like statements that make it possible to apply operations to SharePoint lists data that have been retrieved using list or multiList statements. It's no secret that the operations are rather limited in comparison of SQL language features available when dealing with data tables.

Rather than spending a lot of development effort trying to mimic more sophisticated sql-like operations, our idea is to include some SQL engine into our product and to interface it to SharePoint lists retrieved using list or multiList statements.

For those who are already familiar with ERSDE Queries, here is how an ERSDE Query could look like with SQL Query language added feature:

<?xml version="1.0" encoding="utf-8" ?>

<root xmlns="http://enesyssoftware.com/schemas">

  <list title="Products" relativeSiteUrl="/sites/demo/" tableName="Products">

    <fields>Title, Category</fields>

    <query></query>

  </list>

 

  <list title="Product categories" relativeSiteUrl="/sites/demo/" tableName="ProductCategories">

    <fields>Title, Description</fields>

    <query></query>

  </list>

 

  <list title="Orders" relativeSiteUrl="/sites/demo/" tableName="Orders">

    <fields>OrderID,OrderDate,Employee</fields>

    <query></query>

  </list>

 

  <list title="Order Details" relativeSiteUrl="/sites/demo/" tableName="OrderDetails">

    <fields>Product, Order_x0020_ID, UnitPrice, Quantity, Discount</fields>

    <query></query>

  </list>

 

  <sqlQuery dstTableName="testQuery">

      SELECT OrderDetails.Product, Products.Category, ProductCategories.Description,

          Orders.OrderID, OrderDate, UnitPrice, Quantity, UnitPrice*Quantity As Total

      FROM Products INNER JOIN ProductCategories ON Products.Category = ProductCategories.Title

      INNER JOIN OrderDetails ON Products.Title=OrderDetails.Product

      INNER JOIN Orders ON OrderDetails.Order_x0020_ID=Orders.OrderID

      ORDER BY Product

  </sqlQuery>

  <resultSet>testQuery</resultSet>

</root>

As you can notice, list statements are still used to retrieve data from SharePoint using all the available options provided by Enesys RS Data Extension. A new sqlQuery statement would let you apply a SQL SELECT statement using the SharePoint lists retrieved using list statements as if they were SQL tables. This would obviously open quite some possibilities and make it easier as most people dealing with reports are fluent in SQL.

We have already made some basic tests with SQLite which have been promising.

If we were to provide this feature within Enesys RS Data Extension, we would preferably completely remove support for sqlOp statements. Of course, because many reports have already been built using sqlOp statements (and we have lots of them as well), we would give a new name to the new data extension so that it can be run side by side with the current one (that's what we did when we released the 2.0 version).

We could also decide to keep sqlOp statements for compatibility purpose though it would not be possible to build such statement with our coming query builder.

We are very interested in getting your feedback regarding this possible major change.

Internal and display name

SharePoint list columns have both internal names and display names. When creating a column in a SharePoint list, one will enter some column name. Under the hood, the column internal name is assigned the column display name except for spaces and accentuated characters which are replaced by an hexa value surrounded by underline chars (because of this, we took the habit to first specify a column name without any spaces or special chars on column creation and to change it as soon). From that point, the column internal name will not change though a user with the necessary permissions may change the column (display) name.

Enesys RS Data Extension let's you use either SharePoint columns internal names or display names when building a query by setting useDisplayName attribute to true or false. Using internal names has the advantage of not breaking your report if a column is being renamed. On the other hand, manipulating internal names within the report layout is not particularly great if the internal name has lots of hexa values or even worse if the internal name meaning has nothing to do anymore with the column value which may happen if you reuse some column for holding completely different values than what it was initially intended for.

In order to overcome this limitation we are proposing to extend the syntax of the field element in order to specify your own display name. Here is a sample query using this possible approach:

<?xml version="1.0" encoding="utf-8" ?>

<root xmlns="http://enesyssoftware.com/schemas">

  <list title="Products" relativeSiteUrl="/sites/demo/" tableName="Products">

    <fields>Product=Product_x0020_Name, Category=Cat_x0020_ID, Supplier</fields>

    <query></query>

  </list>

  <resultSet>Products</resultSet>

</root>

Each field within the fields element is specified using the following syntax: <YourOwnDisplayName>=<SharePoint column name> where <SharePoint column name> could be the internal or display name depending on useDisplayName attribute. Specifying your own display name and setting useDisplayName attribute to true doesn’t make a lot of sense but would still be a possible option.


Frederic LATOUR
ENESYS
 
New Post 2/13/2008 5:13 PM
  sbader
30 posts
No Ranking


Re: Feedback needed for possible SQL Query feature 

I think that would be great. It would be nice to have more flexibility within the reports. I really like the idea of treating the lists like tables and doing everything with regular sql. I think it would definitely lower the learning curve between going from regular sql reports to enesys.

 
New Post 2/15/2008 6:42 AM
  Chiarenn
29 posts
No Ranking


Re: Feedback needed for possible SQL Query feature 

It's great to see you guys keeping walking.

Just like to know if this kind of SQL style would work on server side or client side.

Because I would like to know if the data fetching performance would be different if I could give it WHERE clause on the command.

BTW, I also like to know if this new feature supports WHERE clause to interact with report's parameters.

Regards,

Steve Wang

 
New Post 2/15/2008 10:47 AM
  Frédéric LATOUR
550 posts
1st Level Poster


Re: Feedback needed for possible SQL Query feature 
Modified By Frédéric LATOUR  on 2/15/2008 10:50:11 AM)

Hi,

Thanks for the feedback.

To answer your questions:

>Just like to know if this kind of SQL style would work on server side or client side.

It will work at the data extension level. That means on the client side when running from the report designer and at the report server side when running from the report server. This is anyway how it works when using sqlOp statements. In that sense this feature would essentially brings much more possibilites to manipulate data and would make it possible to build much more complex queries without having to write multiple sqlOp statements.

As an example, our sample query would be written as the following when using the current version of Enesys RS Data Extension:

<?xml version="1.0" encoding="utf-8" ?>

<root xmlns="http://enesyssoftware.com/schemas">

  <list title="Products" relativeSiteUrl="/sites/demo/" tableName="Products">

    <fields>Title, Category</fields>

    <query>

    </query>

  </list>

 

  <list title="Product categories" relativeSiteUrl="/sites/demo/" tableName="Product categories">

    <fields>Title, Description</fields>

    <query>

    </query>

  </list>

 

  <list title="Orders" relativeSiteUrl="/sites/demo/" tableName="Orders">

    <fields>OrderID,OrderDate,Employee</fields>

    <query>

    </query>

  </list>

 

  <list title="Order Details" relativeSiteUrl="/sites/demo/" tableName="Order Details">

    <fields>Product, Order_x0020_ID, UnitPrice, Quantity, Discount</fields>

    <query>

    </query>

  </list>

 

  <sqlOp op="join">

    <dstTableName>ProdAndCat</dstTableName>

    <parentTableName>Products</parentTableName>

    <childTableName>Product categories</childTableName>

    <parentFieldName>Category</parentFieldName>

    <childFieldName>Title</childFieldName>

  </sqlOp>

 

  <sqlOp op="join">

    <dstTableName>OrdersAndDetails</dstTableName>

    <parentTableName>Orders</parentTableName>

    <childTableName>Order Details</childTableName>

    <parentFieldName>OrderID</parentFieldName>

    <childFieldName>Order_x0020_ID</childFieldName>

  </sqlOp>

 

  <sqlOp op="join">

    <dstTableName>ProdAndOrdersAndDetails</dstTableName>

    <parentTableName>OrdersAndDetails</parentTableName>

    <childTableName>ProdAndCat</childTableName>

    <parentFieldName>Product</parentFieldName>

    <childFieldName>Title</childFieldName>

  </sqlOp>

  <resultSet>ProdAndOrdersAndDetails</resultSet>

</root>

Though this query is similar to the initial sample query, it is not possible to restrict the selected columns on the fly nor having a calculated column like UnitPrice*Quantity As Total.

>Because I would like to know if the data fetching performance would be different if I could give it WHERE clause on the command.

It would certainly improve the data manipulation performances though we need to make serious tests before being able to make such a claim but would not change the performance regarding fetching data from SharePoint lists.

We entirely rely on SharePoint Web Services for retrieving data from SharePoint lists. In that respect, we can only rely on query features provided by SharePoint Web Services. In order to restrict SharePoint Data returned from a list, we need to specify a filter using CAML Query language. CAML Query language does not provide support for all possible operators and for relational operations with other lists.

Within Enesys RS Data Extension, you can specify a CAML Query within the query element of a list statement. This is where you may improve performance when dealing with big lists.

That said we are hoping to make things easier in the coming versions by providing several features enhancement:

  • Our coming query builder will let you build a CAML Query without having to know the syntax (we will soon give some news about it as well as some flash demo).
  • We will provide some operators that do not exist in CAML and will transform them under the hood into a syntax compatible with CAML Query (for example a IN operator would be replaced by a series of Eq operators connected by Or).

>BTW, I also like to know if this new feature supports WHERE clause to interact with report's parameters.

Sure, it would support report's parameters using the WHERE clause.


Frederic LATOUR
ENESYS
 
New Post 3/7/2008 5:46 PM
  ShareVision
10 posts
No Ranking


Re: Feedback needed for possible SQL Query feature 

First of all, thanks for asking for input from your customers. That's definitely the best way to build a product that people like and will continue to last. It seems obvious but so many of us software guys forget to do this.

I think that the addition of a SQL engine would be a wonderful addition. While we can solve almost any issue with the existing sqlOp statements, we do sometimes have to get creative and limitations like only being able to return one row on a distinct statement can drive a guy crazy. That said, 9 times out of 10 all we need are the simple statements so my preference would be to keep the existing functionality in the same dll and add the SQL engine if at all possible rather than the scenario of them running side by side. One of the reasons for this would be that many of our reports have over 10 datasources in them only maybe one of which would benefit from the new feature. In the side by side scenario I would need to rebuild the entire report (well at least it's datasources) to use the new feature. I also have to admit that while I have built many apps coding directly against SQL Server and Oracle, my SQL has gotten a little rusty while working with SharePoint in the last few years (my CAML has gotten much better though!). I would prefer to only have to use SQL if I got stuck with the existing sqlOps syntax. To that end would you include some kind of SQL statement builder similar to the CAML one you mention?

I also like the idea of allowing us to define our own, datasource specific names for columns. Would be very handy in large reports and for maintenance.

Thanks again for a fine product and keep up the good work!

 
Previous Previous
 
Next Next
  Forum  Enesys RS Data ...  Suggestions  Feedback needed for possible SQL Query feature
 
You need to login for posting to the forums.
If you don't have a login, click here to register.
 
Copyright 2010 Enesys - All rights reserved Terms Of UsePrivacy Statement