InterSystems.Data.CacheClient .net CacheParameter - is there a number of parameters limitation?

132 views
Skip to first unread message

adamp

unread,
Mar 19, 2018, 7:40:14 AM3/19/18
to IRIS, Caché, Ensemble
Hi Folks

I am having an issue with  CacheParameter in my .net project. It doesn't seem to allow me to pass more than 2 parameters into my cache stored procedure. I get the error "Parameter list mismatch". I have tried multiple different version of   InterSystems.Data.CacheClient; but with no success.

My .Net project communicates with my cache database using the cacheClient, but it calls a stored procedure on the cache side

           

working code example

CacheCommand cmd = new InterSystems.Data.CacheClient.CacheCommand("{call mystoredproc(?)}", _conn);

//Add parameters

CacheParameter Rowid = new CacheParameter("Rowid", CacheDbType.NVarChar);

Rowid.Value = ID;

cmd.Parameters.Add(Rowid);


Although this is my first time using this method to connect and pass parameters, im confident I have tried everything to get this working. It works fine with 1 or 2 parameters, but 3 just wont work. I searched documentation for any kind of limitation but found no mention of this. Any help or advice greatly appreciated

Thanks
Adam

tiagoguirado

unread,
Sep 6, 2018, 1:44:45 PM9/6/18
to IRIS, Caché, Ensemble
Hi adamp.

I think the best option here is use '@something' instead '?'.

So your code will be something like that:


CacheCommand cmd = new InterSystems.Data.CacheClient.CacheCommand("{call mystoredproc(@parameter1)}", _conn);


//Add parameters

CacheParameter Rowid = new CacheParameter("@parameter1", CacheDbType.NVarChar);

Rowid.Value = ID;

cmd.Parameters.Add(Rowid);

Leonardo de Souza Pereira

unread,
Sep 12, 2018, 7:31:16 AM9/12/18
to intersystems...@googlegroups.com
Also you can do parameter = parameter1_"^"_parameter2,3,4,5

And break them down after.. if that's the case...



--
--
IRIS, Caché, Ensemble
---
You received this message because you are subscribed to the Google Groups "IRIS, Caché, Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
To post to this group, send email to intersystems...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages