How to Call a Cache Routine from the .NET Cache Client using C#

Hi All,

Is it possible to call a Cache Routine using the .NET Cache Client instead of just SQL statements?

If so, can someone provide an example?

using InterSystems.Data.CacheClient;
using InterSystems.Data.CacheTypes;

Thanks,

-Matt

  • 0
  • 1
  • 234
  • 2
  • 1

Answers

You could use the feature that any Classmethod may also serve as Stored Procedure.

Like this:

Class User.Remote
{
ClassMethod Echo(inout As %String) As %String [ SqlName = Demo, SqlProc ]
return "Echo:"_inout }
}

And then you may call your Procedure like this: getting back

SELECT DEMO('hello WORLD') 

getting back   

Echo:hello WORLD

All you have to care for is to return something.
what happens inside your ClassMethod is up to you and doesn't need to be related.

Can you call a XT Mumps/Cache routine, from the client software?

YES! you can!

Just extend the method (just some example)

ClassMethod exmple(inout As %StringAs %String SqlName ExampleSqlProc ]
{
  do prepare^myMumps(inout)

  set return=$$return^myMUMPS()
 ;;; or whatever is required
   return "Echo:"_return 
}