Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Unanswered: 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]

  2. #2
    Join Date
    Jul 2004
    Posts
    2
    I found problem. There are syntax error (missed parenthesis).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •