Question
Louie McLaughlin · Mar 10, 2022

Passing sql in as text to a command to execute .net

I'm new to cache, come from an oracle and sql server background. In oracle and sql server I could write basically a stored procedure like script and pass it in as text to the command to execute. 

Example:

Below would be the _sqltext

DECLARE @Id INT;

select id into @Id from something;

 if @Id = 9 

BEGIN

do something

END

The _sqltext would work in sql server, what would be the equivalent for cache for it work?

I get a generic error when I try it with cache

using (var mdscmd = new CacheCommand(_sqlText, MyConnection) { CommandType = CommandType.Text }) {

 

}

 

Thanks

Product version: Caché 2018.1
0
0 155
Discussion (2)1
Log in or sign up to continue