![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the Statement> and how would I add that to the <UpdateCells> command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#3
| |||
| |||
|
|
This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the Statement> and how would I add that to the <UpdateCells> command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#4
| |||
| |||
|
|
Its complex, but if UpdateCells can have 0...n Cell elements like the docs describe it provides the mid-tier to back-end batching that I crave. Even the old ADOMD isn't batching updates (you can see each UpdateCells statement coming across inthe SQL Profiler). Time to dig up those SOAP classes... Thanks for the validation. -z "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl... This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the Statement> and how would I add that to the <UpdateCells> command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#5
| |||
| |||
|
|
Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do it in a "safe" manner. I.e. when a cell is updated, it can't know if another cell value in the cellset has been impacted by the update -- so the next "Read" operation on the cellset will trigger a <UpdateCells> and refresh of cellset values. So if your code just did "update, update, update, commit" (without any "reads"), it should see just one <UpdateCells> message. Of course, ADOMD adds another layer into the mix and I can't say whether it would cause a "read" operation when all your code does is Writes. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Its complex, but if UpdateCells can have 0...n Cell elements like the docs describe it provides the mid-tier to back-end batching that I crave. Even the old ADOMD isn't batching updates (you can see each UpdateCells statement coming across inthe SQL Profiler). Time to dig up those SOAP classes... Thanks for the validation. -z "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl... This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the <Statement> and how would I add that to the <UpdateCells> command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#6
| |||
| |||
|
|
I was trying it with ADOMD 2.8 and it would do the UpdateCells after the next cell was set. For example: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); cell.Value = 1000; coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); cell.Value = 2000; // UpdateCells seen on server for ordinal 0 with value 1000 coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); cell.Value = 3000; // UpdateCells seen on server for ordinal 1 with value 2000 Even when I commited the transaction, the most recent cell to be set was not updated (the value of 3000 in my example) unless another cell was accessed. What I *did* notice is that if I set the value for a cell repeatedly and then commited the transaction, only 1 writeback table entry was created. So there was batching between the 2 server side processes, but not at the layer I'm most interested in. -zoltan "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do it in a "safe" manner. I.e. when a cell is updated, it can't know if another cell value in the cellset has been impacted by the update -- so the next "Read" operation on the cellset will trigger a <UpdateCells> and refresh of cellset values. So if your code just did "update, update, update, commit" (without any "reads"), it should see just one <UpdateCells> message. Of course, ADOMD adds another layer into the mix and I can't say whether it would cause a "read" operation when all your code does is Writes. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Its complex, but if UpdateCells can have 0...n Cell elements like the docs describe it provides the mid-tier to back-end batching that I crave. Even the old ADOMD isn't batching updates (you can see each UpdateCells statement coming across inthe SQL Profiler). Time to dig up those SOAP classes... Thanks for the validation. -z "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl... This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the <Statement> and how would I add that to the <UpdateCells command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#7
| |||
| |||
|
|
And what if you did: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 0 }; cell.Value = 1000; coords = new object[2] { 0, 1 }; cell.Value = 2000; coords = new object[2] { 0, 2 }; cell.Value = 3000; And then Commit. You should (theoretically) see only one UpdateCells request... As I said, I'm not sure what ADOMD does in between, so its possible that the cell update causes a Read which would result in each modification also sending a message. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:u$z7FqKSGHA.256 (AT) TK2MSFTNGP14 (DOT) phx.gbl... I was trying it with ADOMD 2.8 and it would do the UpdateCells after the next cell was set. For example: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); cell.Value = 1000; coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); cell.Value = 2000; // UpdateCells seen on server for ordinal 0 with value 1000 coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); cell.Value = 3000; // UpdateCells seen on server for ordinal 1 with value 2000 Even when I commited the transaction, the most recent cell to be set was not updated (the value of 3000 in my example) unless another cell was accessed. What I *did* notice is that if I set the value for a cell repeatedly and then commited the transaction, only 1 writeback table entry was created. So there was batching between the 2 server side processes, but not at the layer I'm most interested in. -zoltan "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do it in a "safe" manner. I.e. when a cell is updated, it can't know if another cell value in the cellset has been impacted by the update -- so the next "Read" operation on the cellset will trigger a <UpdateCells and refresh of cellset values. So if your code just did "update, update, update, commit" (without any "reads"), it should see just one <UpdateCells> message. Of course, ADOMD adds another layer into the mix and I can't say whether it would cause a "read" operation when all your code does is Writes. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Its complex, but if UpdateCells can have 0...n Cell elements like the docs describe it provides the mid-tier to back-end batching that I crave. Even the old ADOMD isn't batching updates (you can see each UpdateCells statement coming across inthe SQL Profiler). Time to dig up those SOAP classes... Thanks for the validation. -z "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl... This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the <Statement> and how would I add that to the <UpdateCells command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#8
| |||
| |||
|
|
Well, I was able to puzzle out the XMLA commands by tweaking an old WSDL file and using an HTTP tunnel to watch the traffic and seem to have gotten things to work. Its odd that the UpdateCells command is even documented on MSDN since you need to use several undocumented commands to actually use it. =) This will also give me finer control over my server roundtrips, so I think it's a win-win for me. Now on to the performance testing.... -zoltan "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:e4Spo5YSGHA.224 (AT) TK2MSFTNGP10 (DOT) phx.gbl... And what if you did: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 0 }; cell.Value = 1000; coords = new object[2] { 0, 1 }; cell.Value = 2000; coords = new object[2] { 0, 2 }; cell.Value = 3000; And then Commit. You should (theoretically) see only one UpdateCells request... As I said, I'm not sure what ADOMD does in between, so its possible that the cell update causes a Read which would result in each modification also sending a message. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:u$z7FqKSGHA.256 (AT) TK2MSFTNGP14 (DOT) phx.gbl... I was trying it with ADOMD 2.8 and it would do the UpdateCells after the next cell was set. For example: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); cell.Value = 1000; coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); cell.Value = 2000; // UpdateCells seen on server for ordinal 0 with value 1000 coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); cell.Value = 3000; // UpdateCells seen on server for ordinal 1 with value 2000 Even when I commited the transaction, the most recent cell to be set was not updated (the value of 3000 in my example) unless another cell was accessed. What I *did* notice is that if I set the value for a cell repeatedly and then commited the transaction, only 1 writeback table entry was created. So there was batching between the 2 server side processes, but not at the layer I'm most interested in. -zoltan "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do it in a "safe" manner. I.e. when a cell is updated, it can't know if another cell value in the cellset has been impacted by the update -- so the next "Read" operation on the cellset will trigger a <UpdateCells and refresh of cellset values. So if your code just did "update, update, update, commit" (without any "reads"), it should see just one <UpdateCells> message. Of course, ADOMD adds another layer into the mix and I can't say whether it would cause a "read" operation when all your code does is Writes. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Its complex, but if UpdateCells can have 0...n Cell elements like the docs describe it provides the mid-tier to back-end batching that I crave. Even the old ADOMD isn't batching updates (you can see each UpdateCells statement coming across inthe SQL Profiler). Time to dig up those SOAP classes... Thanks for the validation. -z "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl... This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the <Statement> and how would I add that to the UpdateCells> command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
#9
| |||
| |||
|
|
So how did you get the ResultID? I am having the same problem. Thanks, Mike "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:uPoXg9eTGHA.2276 (AT) tk2msftngp13 (DOT) phx.gbl... Well, I was able to puzzle out the XMLA commands by tweaking an old WSDL file and using an HTTP tunnel to watch the traffic and seem to have gotten things to work. Its odd that the UpdateCells command is even documented on MSDN since you need to use several undocumented commands to actually use it. =) This will also give me finer control over my server roundtrips, so I think it's a win-win for me. Now on to the performance testing.... -zoltan "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:e4Spo5YSGHA.224 (AT) TK2MSFTNGP10 (DOT) phx.gbl... And what if you did: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); coords = new object[2] { 0, 0 }; cell.Value = 1000; coords = new object[2] { 0, 1 }; cell.Value = 2000; coords = new object[2] { 0, 2 }; cell.Value = 3000; And then Commit. You should (theoretically) see only one UpdateCells request... As I said, I'm not sure what ADOMD does in between, so its possible that the cell update causes a Read which would result in each modification also sending a message. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:u$z7FqKSGHA.256 (AT) TK2MSFTNGP14 (DOT) phx.gbl... I was trying it with ADOMD 2.8 and it would do the UpdateCells after the next cell was set. For example: coords = new object[2] { 0, 0 }; cell = cellset.get_Item(ref coords); cell.Value = 1000; coords = new object[2] { 0, 1 }; cell = cellset.get_Item(ref coords); cell.Value = 2000; // UpdateCells seen on server for ordinal 0 with value 1000 coords = new object[2] { 0, 2 }; cell = cellset.get_Item(ref coords); cell.Value = 3000; // UpdateCells seen on server for ordinal 1 with value 2000 Even when I commited the transaction, the most recent cell to be set was not updated (the value of 3000 in my example) unless another cell was accessed. What I *did* notice is that if I set the value for a cell repeatedly and then commited the transaction, only 1 writeback table entry was created. So there was batching between the 2 server side processes, but not at the layer I'm most interested in. -zoltan "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:uQAalBISGHA.4276 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Actually the old ADOMD (i.e. OLEDB) does batch updates -- but it has to do it in a "safe" manner. I.e. when a cell is updated, it can't know if another cell value in the cellset has been impacted by the update -- so the next "Read" operation on the cellset will trigger a UpdateCells> and refresh of cellset values. So if your code just did "update, update, update, commit" (without any "reads"), it should see just one <UpdateCells> message. Of course, ADOMD adds another layer into the mix and I can't say whether it would cause a "read" operation when all your code does is Writes. Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23OVJaXFSGHA.4456 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Its complex, but if UpdateCells can have 0...n Cell elements like the docs describe it provides the mid-tier to back-end batching that I crave. Even the old ADOMD isn't batching updates (you can see each UpdateCells statement coming across inthe SQL Profiler). Time to dig up those SOAP classes... Thanks for the validation. -z "Akshai Mirchandani [MS]" <akshaim (AT) online (DOT) microsoft.com> wrote in message news:%23wZ3gMicrosoftRGHA.4956 (AT) TK2MSFTNGP09 (DOT) phx.gbl... This API is very complex to use and I wouldn't recommend using it -- it is used internally by the OLE DB provider to support the cellset update capability. You won't be able to do it with ADOMD.NET anyway because it requires an extra SOAP header which ADOMD.NET won't set/get (and you can't customize this)... Thanks, Akshai -- This posting is provided "AS IS" with no warranties, and confers no rights Please do not send email directly to this alias. This alias is for newsgroup purposes only. "Zoltan Grose" <zgrose (AT) mac (DOT) com> wrote in message news:%23t1imF$RGHA.440 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Can I/should I be using AdomdClient to execute a series a XMLA commands? This is what I have so far but UpdateCells is looking for a ResultId on the server. How can I get the ResultId from the response to the <Statement> and how would I add that to the UpdateCells> command? AdomdConnection conn = new AdomdConnection(); conn.ConnectionString = "Provider=msolap;Data Source=192.168.1.10;Initial Catalog=Finance Modeling QA;Integrated Security=SSPI"; conn.Open(); string mdx = null; mdx = "<BeginTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; AdomdCommand cmd = new AdomdCommand(mdx, conn); cmd.Execute(); cmd.CommandText = "<Statement xmlns=\"urn:schemas-microsoft-com:xml-analysis\">SELECT { ([Reserved Time], [2005 Working Outlook], [Reserved Project], [Reserved Location], [Guideline Price], [Reserved Organization]) } ON COLUMNS, { [Censite Tape (1712522)].Children } ON ROWS FROM [Capital Cube]</Statement>"; cmd.ExecuteCellSet(); cmd.CommandText = "<UpdateCells xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><Cell Ordinal=\"0\"><Value xsi:type=\"xsd:int\">1666</Value></Cell></UpdateCells>"; cmd.Execute(); cmd.CommandText = "<CommitTransaction xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\" />"; cmd.Execute(); |
![]() |
| Thread Tools | |
| Display Modes | |
| |