Matthew Long · Jan 23, 2019

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;



2 1 3 411
Log in or sign up to continue

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


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