Showing posts with label querys. Show all posts
Showing posts with label querys. Show all posts

Friday, March 9, 2012

Error in mdx querys with quotation marks

The problem:
When I try to execute a mdx with quotation mark inside, I get an error!
Why?
I know that (') is from mdx language.
Will I have to erase this characters from my databases?
I don't think it's good.
In my javascript code(asp):
var cst = new ActiveXObject("ADOMD.Cellset");
...
cst.Source = strSource + " CELL PROPERTIES FORMATTED_VALUE, BACK_COLOR,
FORE_COLOR";
cst.open();
strSource = " 'with ...'
Select {[Programa].[Sigla].[Todos os Programas].[Ajuda
r 'A INDUSTRIA],
[Programa].[Sigla].[Todos os Programas].[APOIO A PROJ SOCIAL
],[Programa].
[Sigla].[Todos os Programas].[APOIO ENSINO SUPERIO]}
on rows,{[Measures].[Libera'es]} ON COLUMNS FROM [dwe_cubo
_pird] CELL
PROPERTIES FORMATTED_VALUE, BACK_COLOR, FORE_COLOR"
The error occur when I execute cst.open()!
Microsoft? OLE DB Provider for Analysis Services error '80040e14'
Syntax error, expecting SELECT, near: 'A INDUSTRIA],[Programa].[Sigl
a].
[Todos...
Message posted via http://www.droptable.comYou need to double up quotation marks within quotes:

strSource = " 'with ...'
Select {[Programa].[Sigla].[Todos os Programas].[Ajudar
''A INDUSTRIA],
[Programa].[Sigla].[Todos os Programas].[APOIO A PROJ
SOCIAL],[Programa].
[Sigla].[Todos os Programas].[APOIO ENSINO SUPERIO]}
on rows,{[Measures].[Libera'es]} ON COLUMNS FROM [dwe_cubo
_pird] CELL
PROPERTIES FORMATTED_VALUE, BACK_COLOR, FORE_COLOR"[vbcol=seagreen]
Here's an earlier thread that discusses this:
http://groups-beta.google.com/group...erver.olap/msg/
5b1f83a30f0203eb[vbcol=seagreen]
Newsgroups: microsoft.public.sqlserver.olap
From: "George Spofford"
Date: Sat, 1 Jun 2002 07:33:16 -0700
Subject: MDX Error with Current Year's
One of those silly things: double it up inside.
With member [measures].[abc] as
'count(descendants([category]._[all Category].[current
year''s].[actuals],,leaves))'
HTH
George Spofford
Microsoft MVP
Chief Architect / OLAP Solution Provider
DSS Lab
http://www.dsslab.com
geo...@.dsslab.com
ISVs & IT organizations: Find out how DSS Lab can speed
your development!
[vbcol=seagreen]
>--Original Message--
>Hello,
>the following MDX fails:

>The error comes because the uniquename is ..year's]

>With member [measures].[abc] as
>'count(descendants([category]_.[all Category].[current
>year's].[actuals],,leaves))'

>How can i write a valid mdx?
[vbcol=seagreen]
>Thanks for reading this
>Jrg
>.
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!|||There is another error!
Microsoft? OLE DB Provider for Analysis Services error '80040e14'
Formula error - cannot find dimension member ("[Programa].[Sigla].&#
91;Todos os
Programas].[APOIO ''A INDUSTRIA]") - in a name-binding function
/Server_1.asp, line 520
"Deepak Puri" wrote:

> You need to double up quotation marks within quotes:
>
> strSource = " 'with ...'
> Select {[Programa].[Sigla].[Todos os Programas].[Ajud
ar ''A INDUSTRIA],
> [Programa].[Sigla].[Todos os Programas].[APOIO A PROJ
> SOCIAL],[Programa].
> [Sigla].[Todos os Programas].[APOIO ENSINO SUPERIO]}
> on rows,{[Measures].[Libera'es]} ON COLUMNS FROM [dwe_cu
bo_pird] CELL
> PROPERTIES FORMATTED_VALUE, BACK_COLOR, FORE_COLOR"
>
> Here's an earlier thread that discusses this:
> http://groups-beta.google.com/group...erver.olap/msg/
> 5b1f83a30f0203eb
> Newsgroups: microsoft.public.sqlserver.olap
> From: "George Spofford"
> Date: Sat, 1 Jun 2002 07:33:16 -0700
> Subject: MDX Error with Current Year's
> One of those silly things: double it up inside.
> With member [measures].[abc] as
> 'count(descendants([category].-[all Category].[current
> year''s].[actuals],,leaves))'
> HTH
> --
> George Spofford
> Microsoft MVP
> Chief Architect / OLAP Solution Provider
> DSS Lab
> http://www.dsslab.com
> geo...@.dsslab.com
> ISVs & IT organizations: Find out how DSS Lab can speed
> your development!
>
>
>
>
>
>
> - Deepak
> Deepak Puri
> Microsoft MVP - SQL Server
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
>|||Maybe you used double-quote characters (Ascii 34), instead of 2
single-quote characters (Ascii 39) - that's the only way I could create
the error message you got?
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!|||Did you copy your code from your application source and paste it here?
The reason I ask is that in my Internet Explorer, the so-called single
quote characters in the member names do not appear as single quotes but
rather as unicode gibberish. The single quotes surrounding calculation
value definitions appear as they should.
The fact your mdx runs on some applications and does not on others leads
me to be farely certain that the member names in your cube do not
contain regular single quote characters but other characters, and that
is what causes your problems.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!