dbTalk Databases Forums  

Retrieve Cube data using SQL queries

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Retrieve Cube data using SQL queries in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sendakil
 
Posts: n/a

Default Retrieve Cube data using SQL queries - 09-10-2003 , 04:33 AM







Hi,



Actually I know how to retrieve cube data using the MDX query. I have a
thought of why we cannot use the SQL queries to retrieve the data. So I
tried the below vb program, am getting the error " The cube
'mnr_Actuals' does not exist, or it is not processed "

Actually the cube is existing in the database as well as was processed
successully. I checked the permission of the cube was given everyone
rights. Eventhough I get the above error.



First up all I want to know whether we can use the normal SQL queries to
retrieve the data. If we can why this error occured. Please, help me to
sort out this problem.



Appreciate your help as soon as possible...





vb program:



Dim con As New ADODB.Connection

Dim sQry As String

Dim rs As ADODB.Recordset



sQry = sQry & "SELECT " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Categories:Major Cost Pool],
[mnr_Actuals].[Cost Categories:Major Cost Pool!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Categories:Cost Categories],
[mnr_Actuals].[Cost Categories:Cost Categories!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Geography:Region],
[mnr_Actuals].[Cost Geography:Region!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Geography:Sub Region],
[mnr_Actuals].[Cost Geography:Sub Region!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Geography:Country],
[mnr_Actuals].[Cost Geography:Country!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Pl Key],
[mnr_Actuals].[Cost Product:Pl Key!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Family],
[mnr_Actuals].[Cost Product:Family!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Platform],
[mnr_Actuals].[Cost Product:Platform!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Part Number],
[mnr_Actuals].[Cost Product:Part Number!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Time:Fy], [mnr_Actuals].[Cost
Time:Fy!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Time:Yyq], [mnr_Actuals].[Cost
Time:Yyq!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Time:Yymm], [mnr_Actuals].[Cost
Time:Yymm!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Version:Version Name],
[mnr_Actuals].[Cost Version:Version Name!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Measures:Act Costqty]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Measures:Total Act Costs]" & vbCrLf

sQry = sQry & "FROM [mnr_Actuals] " & vbCrLf





con.Provider = "MSOLAP.2"

con.Open ("Datasource=XM6002;InitialCatalog=abc_mno")

Set rs = New ADODB.Recordset

rs.Open sQry, con

con.Close





Many thanks in advance...



Regards

Senthil


--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
ramblk
 
Posts: n/a

Default Re: Retrieve Cube data using SQL queries - 09-10-2003 , 04:53 AM







Hello,

try to connect to this cube using ms excel xp. Is it succesfull?


--
Posted via http://dbforums.com

Reply With Quote
  #3  
Old   
Terry M. Ledet
 
Posts: n/a

Default Retrieve Cube data using SQL queries - 09-22-2003 , 03:59 PM



http://support.microsoft.com/default.aspx?scid=kb;en-
us;218592 has some examples using SQL with OpenRowset
Quote:
-----Original Message-----

Hi,



Actually I know how to retrieve cube data using the MDX
query. I have a
thought of why we cannot use the SQL queries to retrieve
the data. So I
tried the below vb program, am getting the error " The
cube
'mnr_Actuals' does not exist, or it is not processed "

Actually the cube is existing in the database as well as
was processed
successully. I checked the permission of the cube was
given everyone
rights. Eventhough I get the above error.



First up all I want to know whether we can use the normal
SQL queries to
retrieve the data. If we can why this error occured.
Please, help me to
sort out this problem.



Appreciate your help as soon as possible...





vb program:



Dim con As New ADODB.Connection

Dim sQry As String

Dim rs As ADODB.Recordset



sQry = sQry & "SELECT " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Categories:Major
Cost Pool],
[mnr_Actuals].[Cost Categories:Major Cost Pool!KEY]," &
vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Categories:Cost
Categories],
[mnr_Actuals].[Cost Categories:Cost Categories!KEY]," &
vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Geography:Region],
[mnr_Actuals].[Cost Geography:Region!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Geography:Sub
Region],
[mnr_Actuals].[Cost Geography:Sub Region!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Geography:Country],
[mnr_Actuals].[Cost Geography:Country!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Pl Key],
[mnr_Actuals].[Cost Product:Pl Key!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Family],
[mnr_Actuals].[Cost Product:Family!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Platform],
[mnr_Actuals].[Cost Product:Platform!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Product:Part Number],
[mnr_Actuals].[Cost Product:Part Number!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Time:Fy],
[mnr_Actuals].[Cost
Time:Fy!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Time:Yyq],
[mnr_Actuals].[Cost
Time:Yyq!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Time:Yymm],
[mnr_Actuals].[Cost
Time:Yymm!KEY]," & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " " & vbCrLf

sQry = sQry & " [mnr_Actuals].[Cost Version:Version
Name],
[mnr_Actuals].[Cost Version:Version Name!KEY]," & vbCrLf

sQry = sQry & " [mnr_Actuals].[Measures:Act Costqty]," &
vbCrLf

sQry = sQry & " [mnr_Actuals].[Measures:Total Act
Costs]" & vbCrLf

sQry = sQry & "FROM [mnr_Actuals] " & vbCrLf





con.Provider = "MSOLAP.2"

con.Open ("Datasource=XM6002;InitialCatalog=abc_mno")

Set rs = New ADODB.Recordset

rs.Open sQry, con

con.Close





Many thanks in advance...



Regards

Senthil


--
Posted via http://dbforums.com
.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.