dbTalk Databases Forums  

How to retreive defined actions on a cell?

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


Discuss How to retreive defined actions on a cell? in the microsoft.public.sqlserver.olap forum.



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

Default How to retreive defined actions on a cell? - 09-28-2004 , 03:41 AM






I have tried using the OpenSchema it works fine to get action defined for
member but how to get defined actions for cells?

Set oRs = oCon.OpenSchema(adSchemaActions, _
Array("", "", mstrCube, "", MDACTION_TYPE_URL, ??, _
MDACTION_COORDINATE_CELL))

What parameters should be used for the OpenSchema function?


/Christer



Reply With Quote
  #2  
Old   
Mingqing Cheng [MSFT]
 
Posts: n/a

Default RE: How to retreive defined actions on a cell? - 09-28-2004 , 05:24 AM






Hi Christer,

Thanks for your post.

From your descriptions, I understood that you would like to know how to set
COORDINATE parameter in MDSCHEMA_ACTIONS when query to be adSchemaActions.
Have I understood you? Correct me if I was wrong.

From BOL, we could find the description below for COORDINATE column in
MDSCHEMA_ACTIONS

A Multidimensional Expressions (MDX) expression that specifies an object or
a coordinate in the multidimensional space in which the action is executed.
It is the responsibility of the client application to provide the value of
this restriction column.

It'll be part of obtaining the list of actions. As far as using one, if
you've defined it for the members of a dimension, then the name of a member
in that dimension would be passed in as the coordinate, and the
MDACTION_COORDINATE_MEMBER coordinate type. For every scope, there's a
corresponding COORDINATE_TYPE and coordinate format. See more detailed
descriptions in the document below

MDSCHEMA_ACTIONS
http://msdn.microsoft.com/library/de...us/olapdmpr/pt
_prschemas_419v.asp

Thank you for your patience and corperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!


Sincerely yours,

Mingqing Cheng

Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---------------------------------------------------------------
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!



Reply With Quote
  #3  
Old   
keith
 
Posts: n/a

Default Re: How to retreive defined actions on a cell? - 09-28-2004 , 11:43 AM



Christer,

Here is how we do it. Note that this is a J++ example, but you should be
able to get the jist of it. The context is based on Foodmart, and the
returned rowset will be empty because there are no cell actions at that
context, but you should get the idea.

//create noparam variant
Variant noParam = new Variant();
noParam.noParam();

Variant empty = new Variant();
empty.putNull();

com.ms.com.SafeArray safea = new
com.ms.com.SafeArray(Variant.VariantVariant, 7);

// here you create a array of restrictions just like many other schema
rowset calls
safea.setVariant(2, new Variant("Sales")); // Cube name
safea.setVariant(4, new Variant(0x0));
safea.setVariant(5, new Variant("[Customers].[All Customers]")); //
Context tuple
safea.setVariant(6, new Variant(MDACTION_COORDINATE_CELL));

Variant restrictions = new Variant(safea, true);

//run the query.
Recordset actions = getADOConn().OpenSchema(
msado15.SchemaEnum.adSchemaProviderSpecific,
restrictions,
new
com.ms.com.Variant("{a07ccd08-8148-11d0-87bb-00c04fc33942}"));


Ok, so a word about the last parameter. Back in the day (about 4 years ago)
when we were adding actions support to our client app, there wasn't a
defined rowset value that we could find for actions, so we weasled the GUID
for them out of some AS2000 guys we knew and used that. Worked then, works
now. Might be a more "official" way now (hopefully) but I've never bothered
to look into it. Ain't broke. don't fix, etc.

Hope this helps point you in the right direction!

Keith

"Christer K" <a@b.com> wrote

Quote:
I have tried using the OpenSchema it works fine to get action defined for
member but how to get defined actions for cells?

Set oRs = oCon.OpenSchema(adSchemaActions, _
Array("", "", mstrCube, "", MDACTION_TYPE_URL, ??, _
MDACTION_COORDINATE_CELL))

What parameters should be used for the OpenSchema function?


/Christer





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.