Custom SQL queries in PerformancePoint DashBoard designer - sql

Is it possible to utilize the data that is returned by a CUSSTOM SQL query on a database to create the DasshBoard elements ?
So far i was ablle to connect to a specific Table and use it in AS IS form ( no interaction with multible tables )
Any pointers in this topic would be much appreciated.
Thanks,
IP.

I'd recommend creating a View in your database and creating a datasource that connects to that view. The view would join all the tables you need.
Edit:
If you don't have permissions to create a view, you still have some options:
stand up a SQL box you control, create a linked server to the one you don't, and create the view in your control
create an Access database, with a linked table to the tables you want. create your view there, and use that as your ODBC datasource in dashboard designer.
Give to the DBA the query you want and ask them to create the view for you. If you have permissions to create the query, there should be no problem creating the view (better performance, stability of the data, etc)

Related

reading data from another db

Let's say I have main database called db1. There is also another database called db2. Sometimes I need to get data from db2. Is it better to directly get data from db2 or to make view in db1?
If you're getting data from db2 you should create views in db2 for each query. Why? To create interfaces.
If someone will make changes in db2 he don't know your queries which are executed from db1. Your queries can stop working. If you create views for your queries in db2 and from db1 query view#db2 anyone who change structure in db2 will see invalid view in case his changes damaged your queries.
Of course I mean situation when your queries are embedded in packages or views. If you just query for analytic purpose it make no difference if you do it directly, with view on db1 or view on db2 just do as it is suitable for you. But good practice is setting interfaces so I would recommend to create view on db2 for datasets your later querying from db1. It can also make sense to create additional view or synonym on db1 side to have both side interface.
You will first need to set up a driver for connectng to DB2, a TNS connection entry for Oracle to connect with and a database link in Oracle to point to the connection.
The important thing is that you try, as far as possible, to insulate changes in one DB from the other.
I've this done different ways but this has worked for me;
For each table you are querying in DB2 create a DB2 view of JUST the columns you want from that table.
Create a view in Oracle that queries DB2_VIEW#DB2_database. Although not strictly necessary just query the columns you want - its good practice.
Create a synonym for the view and query through that. If the source of the data changes and the view is replaced by a different one you can switch the synonym to point at the new view instead of changing your code.
Summary:
Unless I've misunderstood you seem to be asking should I query the table directly in DB2 or should I go through views? I suggest that going through views insulates you from changes at either end to some extent so use the views.

MS Access: Viewing SQL for tables, relationships etc and not just queries

I am trying to get some help online for my Access created database in an SQL chatroom but I am being asked to show the SQL for it. I am unable to do this and it seems the SQL View function only shows up for queries and not tables or relationships etc.
Nothing comes up online and I have been told that it is apparently possible to code in raw SQL in Access for everything (and I imagine view the database code) so could someone please tell me how I might go about this?
Its much easier to just create a screenshot of the relationship window and send it to them. If you are using window 7 you could just use the snipping tool on the fly.:)
Other thing you could do is create a query and add the affected tables in the query builder then switch to SQL view. you should be able to see the joins from there.

Can I create view in my database server from another database server

Is it possible to create view in my database server of another servers database table?
Let's say you have a database called Testing on server1 and you have another database Testing2 on server2. Is it possible to create view of Testing2's table Table2 in server1's database Testing?
Also, I am using SQL Server 2008.
Please let me know if you have any questions.
Thanks,
Yes, you can. First, you need to link to the other server, using something like sp_addlinkedserver.
Then you can access the data using 4-part naming. Here is an example:
create view v_server1_master_tables as
select *
from server1.master.information_schema.tables;
It is possible through linked servers. However, I wouldn't encourage you to create views based on tables from another server, as it's likely that entire table will be selected from linked server every time you use this view - optimizer may not know about this table structure to issue any filters.
I've seen it at work, where nobody knew where select * from queries on large table come from that were slowing down the database, and it appeared that it was being used somwhere in another server, in a simple query.
At least you should check if your solution won't cause the above problem. Maybe someone else could elaborate on how optimizer behave when dealing with linked servers?

creating a pivot table from an SQL view, but view is not available in data connection wizard

I'm trying to create an Excel pivot table from a Microsoft SQL view, however, my view is not showing up in the data connection wizard window. Is there some setting that I'm missing that would allow me to see views, also? Security privileges shouldn't be an issue, as I'm working at dbo priv level.
never mind - i figured it out: while the list appears to be a straight alpha sort, it actually lists all views, and then all tables.

Can I set up materialised views on oracle for a SQL Server table over sqllink?

I have a table in a SQL Server database that needs to be visible to an oracle database. We have tried using a normal view over sqllink, but we are not able to create an onUpdate triggers on that view.
I have read that we can create the trigger if it is a materialised view, but is unable to find any information on whether it can be done across different databases. (all the example are for oracle to oracle tables)
Can someone tell me if it is possible? and what issues I might need to look out for if I used materialised views?
Thanks
I do something similar and ended up using Oracle's HS gateway to handle it. Created an MV based of tables or queries to establish a staging area in Oracle. Followed up with logic to meet requests.