If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > Problems with creating local cub

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-15-04, 08:50
WindJammer WindJammer is offline
Registered User
 
Join Date: Jul 2004
Posts: 2
Problems with creating local cub

I'm trying to create local cube file in my program (.net C#), without MS AS, directly load data from MS SQL Server.
Exception message: “Parsing error occurred prior to ‘CREATE CUBE…..”


[code c#]

string str,strLocation, strDSN, strCreate, strInsert;

strCreate="";
strCreate+=@"CREATE CUBE Sales( ";
strCreate+=@" DIMENSION [Country], LEVEL [All] TYPE ALL, LEVEL [Country], ";
strCreate+=@" LEVEL [City], LEVEL [CustomerID], ";
strCreate+=@" DIMENSION [Salesperson], LEVEL [All] TYPE ALL, LEVEL [Salesperson],";
strCreate+=@" DIMENSION [ShipperName], LEVEL [All] TYPE ALL, LEVEL [ShipperName], ";
strCreate+=@" DIMENSION [CategoryName],LEVEL [All] TYPE ALL, LEVEL [CategoryName], ";
strCreate+=@" LEVEL [ProductName], ";
strCreate+=@" DIMENSION [OrderDate] TYPE TIME, LEVEL [All] TYPE ALL, ";
strCreate+=@" LEVEL [Year] TYPE YEAR, ";
strCreate+=@" LEVEL [Quarter] TYPE QUARTER, ";
strCreate+=@" LEVEL [Month] TYPE MONTH, ";
strCreate+=@" LEVEL [Day] TYPE DAY, ";
strCreate+=@"MEASURE [Sum Of ExtendedPrice] FUNCTION SUM, ";
strCreate+=@"MEASURE [Sum Of Quantity] FUNCTION SUM ";

strInsert="";
strInsert+=@"InsertInto=INSERT INTO Sales ";
strInsert+=@" [Country].[Country], [City], [CustomerID], ";
strInsert+=@" [Sum Of ExtendedPrice], [Sum Of Quantity], ";
strInsert+=@" [ShipperName].[ShipperName], [Salesperson].[Salesperson], ";
strInsert+=@" [CategoryName].[CategoryName], ";
strInsert+=@" [ProductName], [OrderDate]) ";
strInsert+=@"OPTIONS ATTEMPT_ANALYSIS ";
strInsert+=@"SELECT Invoices.Country, Invoices.City, Invoices.CustomerID, ";
strInsert+=@" Invoices.ExtendedPrice, Invoices.Quantity, Invoices.ShipperName, ";
strInsert+=@" Invoices.Salesperson, Categories.CategoryName, ";
strInsert+=@" Products.ProductName, Invoices.OrderDate ";
strInsert+=@"FROM Northwind.dbo.Categories Categories,";
strInsert+=@" Northwind.dbo.Invoices Invoices,";
strInsert+=@" Northwind.dbo.Products Products ";
strInsert+=@"WHERE Categories.CategoryID = Products.CategoryID ";
strInsert+=@"AND Invoices.ProductID = Products.ProductID ";

//strDSN= "SOURCE_DSN=\"DRIVER=SQL Server;SERVER=SERVER;DATABASE=Northwind\"" ;
strDSN="SOURCE_DSN=\"Provider=SQLOLEDB.1;Data Source = SERVER;Initial Catalog = Northwind\"" ;
strLocation=@"PROVIDER=MSOLAP;DATA SOURCE= E:\test1.cub";
str=strLocation+";"+strDSN+";"+strCreate+";"+strIn sert+";";



System.Data.OleDb.OleDbConnection conn=new System.Data.OleDb.OleDbConnection(str);
conn.Open();
conn.Close();



[/code]
Reply With Quote
  #2 (permalink)  
Old 07-16-04, 02:36
WindJammer WindJammer is offline
Registered User
 
Join Date: Jul 2004
Posts: 2
I found problem. There are syntax error (missed parenthesis).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On