
| General Notice: Upcoming Events: BI show Toulouse: Oct 18. There are 50 ASUG sponsored events in the next 45 days, see calendar for details. |
| Author |
Message |
JohnJustus Forum Enthusiast


Joined: 25 Jun 2007
   Posts: 1208 Location: Dallas, TX

|
Posted: Mon Feb 08, 2010 2:13 pm Post subject: CustomSQL |
|
|
Hi,
I am developing a Webi and writing some Custom SQL on the SQL Viewer.
When I use any new objects to Result objects pane, my old custom SQL got reverted back to SQL generated by the query.
How can I avoid this, because I will be dragging often some objects in the query panel and every time I do that I have to rewrite the code again.Copy and paste also did not work. Any workaround on this.
Thanks.. |
|
| Back to top |
|
 |
vigi_guna Principal Member


Joined: 09 Jul 2008
  Posts: 151 Location: Brisbane, Australia

|
Posted: Mon Feb 08, 2010 6:34 pm Post subject: Re: CustomSQL |
|
|
When you add a new object to your "Query result" pane, the custom SQL has to be changed. Because, the number of columns returned (and data type) must match with the number of objects in the query result (and its data type). So, it is mandatory to change the query based on objects added/removed from the query results. However, I am not aware of "locking" the custom SQL. _________________ Regards,
Guna (BOCP-BOE XI 3, Web I) |
|
| Back to top |
|
 |
weaver Principal Member


Joined: 16 Oct 2008
 Posts: 122

|
Posted: Mon Feb 08, 2010 9:51 pm Post subject: Re: CustomSQL |
|
|
You are probably best to use the ViewSQL feature and make a copy of the SQL before you start. You can then add a column in a text editor or query tool, test your code, then paste it back into Webi's SQL window.
Another hint is to rename the query in Webi. Instead of having it called Query 1 or something like Sales ... rename it DoNotChange. Then other developers will at least know that there is custom SQL behind the definition. |
|
| Back to top |
|
 |
JohnJustus Forum Enthusiast


Joined: 25 Jun 2007
   Posts: 1208 Location: Dallas, TX

|
Posted: Tue Feb 09, 2010 9:15 am Post subject: Re: CustomSQL |
|
|
Ok. Thats a useful information about renaming the query.
Perhaps, Do you know what would be disadvantages of using Custom SQL in the Webi reports? Have you faced any issues after deployment and if we need to modify the report later what challenges can be faced?
Thanks.. |
|
| Back to top |
|
 |
Mak 1 Forum Fanatic


Joined: 06 Jan 2005
     Posts: 6656 Location: London

|
Posted: Tue Feb 09, 2010 9:20 am Post subject: Re: CustomSQL |
|
|
| Quote: | | Do you know what would be disadvantages of using Custom SQL in the Webi reports? |
If you DB changes then your report(s) could become invalid.
You are facing one of the disadvantages now, if someone does add an object by mistake they could lose all of your custom SQL.
Also, unless you store or name them in a certain way, how will anyone know what is custom SQL and what isn't?
Custom SQL has no place in a, production, Business Objects environment, IMO. _________________ Next Available for Contract Work October 2010.
Business Objects Versions 4,5,6, XI R2, 3.2
Oracle, SQL Server, Sybase, Netezza.
Red Adair: "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." |
|
| Back to top |
|
 |
JohnJustus Forum Enthusiast


Joined: 25 Jun 2007
   Posts: 1208 Location: Dallas, TX

|
Posted: Tue Feb 09, 2010 9:45 am Post subject: Re: CustomSQL |
|
|
Hi Mak,
Thanks for the information. I am very new to this CustomSQL stuffs on Webi.
What you mean by Custom SQL has no place in a, production, Business Objects environment, IMO.?
Thanks.. |
|
| Back to top |
|
 |
Andreas Forum Aficionado


Joined: 20 Jun 2002
       
*2 Posts: 13527 Location: You're waiting for a train. A train that will take you far away..

|
Posted: Tue Feb 09, 2010 9:56 am Post subject: Re: CustomSQL |
|
|
Typically, a WebIntelligence document is based on a universe, the universe is essentially a SQL generator. If the universe changes those changes propagate to the Webi documents automatically.
If you override and hardcode the SQL code you are setting yourself up for a maintenance nightmare. Instead of handling everything centrally at the universe level you now have to deal with each single data provider in each single Webi document for maintenance. For esample a table name changes? Well, have fun changing each hardcoded-SQL data provider you ever created.. Your documentation is always up-to-date, right?
You might as well use a different tool alltogether, as one of the main benefits of WebIntelligence is the ease of use and ease of maintenance provided by the semantical layer (=universes). _________________ A smile a day, click here
Follow me on Twitter
Who is your Friend? Search is Your Friend™
Focusing on Visualization Information, Looking at XI 4/Aurora, SAP BOE XI 3.1 SP3, SAP connectivity, Data Modelling, Project Management
Last edited by Andreas on Wed Feb 10, 2010 11:31 am, edited 2 times in total |
|
| Back to top |
|
 |
REB01 Principal Member


Joined: 29 Nov 2004
     Posts: 274 Location: Overland Park, Kansas

|
Posted: Tue Feb 09, 2010 10:00 am Post subject: Re: CustomSQL |
|
|
| JohnJustus wrote: | Hi Mak,
Thanks for the information. I am very new to this CustomSQL stuffs on Webi.
What you mean by Custom SQL has no place in a, production, Business Objects environment, IMO.?
Thanks.. |
In other words, if the report(s) with custom SQL are used in a production environment, it is possible that someone will change the query by adding an object to the report. As soon as that happens, your SQL is changed and your report will no longer function as you expect.
A custom SQL report should have only one user, the person who created it, therefore it is not in the production environment.
FYI ~ "IMO" = In My Opinion _________________ REB
"Knowledge is taught, wisdom is shared and in sharing there is understanding." |
|
| Back to top |
|
 |
JohnJustus Forum Enthusiast


Joined: 25 Jun 2007
   Posts: 1208 Location: Dallas, TX

|
Posted: Tue Feb 09, 2010 10:12 am Post subject: Re: CustomSQL |
|
|
yes I agree with Andreas and mak. I will think about fixing the issue in the universe level itself instead of fixing it in the report level (using Custom SQL)
But in regards to production, I don't think the user can modify the report, at least in our environment. Is there any other scenario in production?
Thanks.. |
|
| Back to top |
|
 |
Mak 1 Forum Fanatic


Joined: 06 Jan 2005
     Posts: 6656 Location: London

|
Posted: Tue Feb 09, 2010 10:28 am Post subject: Re: CustomSQL |
|
|
| Quote: | | Is there any other scenario in production? |
Not in my view .
Andreas should have given you enough, additional, reasons, not to do this.. _________________ Next Available for Contract Work October 2010.
Business Objects Versions 4,5,6, XI R2, 3.2
Oracle, SQL Server, Sybase, Netezza.
Red Adair: "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." |
|
| Back to top |
|
 |
weaver Principal Member


Joined: 16 Oct 2008
 Posts: 122

|
Posted: Wed Feb 10, 2010 9:54 pm Post subject: Re: CustomSQL |
|
|
Yep CustomSQL is evil. In 2000+ reports in our current deployment there would be less than 10 that have needed it.
One other issue is in migrating. If you migrate from one version of BO to another your customSQL might break. So you might be OK now, but not for the next release.
Another tip that I sometimes use. If you have CustomSQL, copy it into a text document. Then load that text document into Infoview. You will now have a Webi doc called ABC.wid and a text doc called ABC_sql.txt
At least then if someone innocently edits your report, you can at least get back to the old SQL. |
|
| Back to top |
|
 |
JPetlev Principal Member


Joined: 01 Nov 2006
   Posts: 369

|
Posted: Thu Feb 11, 2010 2:17 pm Post subject: Re: CustomSQL |
|
|
We actually had a need a while ago with XIR2 to use Custom SQL... If I remember right, it was two different occasions.. once was because there was a function that BO didn't support properly via the Universe (Though I suspect it was actually a faulty universe design), and the other had something to do with stored procedures which are NOW supported in Universe directly.
What we did to try to 'prevent' any issues.. is we had an object created in the universe that was called "!!CUSTOM SQL USED!!" = "Custom SQL In Use".
Our best-practice training basically told users that should they ever find the need to use Custom SQL, to use that object and make sure it appears FIRST in the Result pane objects. That way any subsequent person would be able to easily identify that custom sql was used, and ideally not overwrite it by accident.
Of course that doesn't solve the main issues brought up here of support and whatnot.. but if you find yourself having to use Custom SQL AND allowing users to change queries, then it is a good stop-gap measure to at least identify when it happens.
EDIT:
I forgot to mention that today I do use Custom SQL, but only in the universe LOV's at times... when I do that, I always place an object both above and below that object in the list that specifies "Custom SQL in Object ABOVE/BELOW" which is 'hidden' so it is only shown to developers. To store the SQL I placed it in one of the information tech tabs on the object itself as a backup. It works nicely. |
|
| Back to top |
|
 |
Mak 1 Forum Fanatic


Joined: 06 Jan 2005
     Posts: 6656 Location: London

|
Posted: Fri Feb 12, 2010 1:58 am Post subject: Re: CustomSQL |
|
|
Some useful tips there, guys, when dealing with the custom SQL "problem".
 _________________ Next Available for Contract Work October 2010.
Business Objects Versions 4,5,6, XI R2, 3.2
Oracle, SQL Server, Sybase, Netezza.
Red Adair: "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." |
|
| Back to top |
|
 |
JohnJustus Forum Enthusiast


Joined: 25 Jun 2007
   Posts: 1208 Location: Dallas, TX

|
Posted: Mon Feb 22, 2010 10:07 am Post subject: Re: CustomSQL |
|
|
Hi weaver,
Anyway I had to go with Custom SQL because of time limitations and so on.. The report will go production soon.
Instead of having a copy of the custom SQL, how about having a copy of the report itself. Do you or any one see any disadvantages in this case.
Thanks everyone for their tips.
Thanks.. |
|
| Back to top |
|
 |
|
|