intersystems-cache

Complex LEFT JOIN not working as expected

元气小坏坏 提交于 2019-12-12 03:49:28
问题 DBMS is intersystems-cache! Here is my full query: SELECT m.Name AS MessageType, COUNT(l.name) AS MessageCount, CAST(AVG(ResponseTime) AS DECIMAL(5, 2)) AS AvgResponseTime FROM (SELECT DISTINCT(name) FROM ENSLIB_HL7.Message) m LEFT JOIN ( SELECT CAST(li.SessionId AS Bigint) AS session_id, li.name, MIN(li.TimeCreated) AS SessionStart, MAX(lo.TimeCreated) AS SessionEnd, CAST(DATEDIFF(s, MIN(li.TimeCreated), MAX(lo.TimeCreated)) AS DECIMAL(5, 2)) AS ResponseTime FROM (SELECT h1.SessionId, h1

How do I setup an InterSystems Cache Data Source in Jaspersoft Studio

一个人想着一个人 提交于 2019-12-12 03:29:12
问题 I am trying to set up a new JDBC connection to an Intersystems Cache data source, and I'm struggling to know if it can even be done. Since there was no Intersystems Cache option in the JDBC driver drop down, I added the driver string manually -> com.intersys.jdbc.CacheDriver I then added the URL manually in the following format -> jdbc:Cache://123.123.123.123:12345/namespace I also found the JDBC driver and have added it to the Jar File Path -> cachedb.jar Based on the error message, I am

Intersystems CACHESQL Database Globals to ODBC or cacheSQL client

和自甴很熟 提交于 2019-12-11 12:08:55
问题 I have a Intersystems CacheSQL Database which I have to work with in .net (VB or C#). The problem though, is that most data are not stored in Intersystem's CacheSQL, but rather in it's GLOBALS storage (which I think are arrays). A GLOBALS array looks like this: ^BACKTR("INDX","COMPANY",1,63543,5870) ^BACKTR("DATA","STATISTICS",5870) = "613"_$c(1)_"3503||0"_$c(1)_"82"_$c(1)_"1"_$c(1)_"49"_$c(1)_"1"_$c(1)_"1950"_$c(1)_"63543"_$c(1)_"11301"_$c(1)_"3"_$c(1)_"CORP-A1"_$c(1)_"1656.06"_$c(1)_"150"_

Output a list of GLOBALS or a single GLOBAL value with VisM

拟墨画扇 提交于 2019-12-11 11:59:48
问题 I have dded a VisM control into vb.net via adding a reference to VisM.ocx and adding it in my toolbox as an activeX control. I added the following code in a button: Try 'open the connection AxVisM1.Connect("CN_IPTCP:127.0.0.1[1972]") 'set namespace to livedata (for formal namespaces, use the @ symbol) AxVisM1.NameSpace = "LIVEDATA" 'do stuff. MsgBox("Cache is now active") 'close the connection AxVisM1.DeleteConnection() Catch ex As Exception 'close the connection AxVisM1.DeleteConnection()

Can't get parameters to work with OdbcConnection in C#

怎甘沉沦 提交于 2019-12-11 04:09:59
问题 I'm running a query with a couple date constraints. If I execute the code below with the dates hardcoded and no parameters, I get a result I expect (a simple integer). However, when I try to use parameters I get an empty result set. No errors, just no results. log("Connecting to SQL Server..."); string connectionString = "DSN=HSBUSTEST32;"; string queryString = "SELECT COUNT(*) FROM Table WHERE myDateTime >= '?' AND myDateTime < '?'"; //string queryString = "SELECT COUNT(*) FROM Table WHERE

Return 0 in GROUP BY when COUNT(*) is NULL

旧巷老猫 提交于 2019-12-11 02:09:46
问题 Here is my original query: SELECT CAST(IndexedDate as varchar), COUNT(*) AS Logins FROM Table WHERE EventType = 'Login' AND IndexedDate > DATEADD(mm, -1, GETDATE()) GROUP BY IndexedDate ORDER BY IndexedDate DESC This would leave gaps, for example: 2016-09-13 41 2016-09-12 31 2016-09-09 15 2016-09-08 36 Based on this question, I tried the following and still received the gaps but on top of that the results were wrong (the numbers were MUCH higher): SELECT CAST(IndexedDate as varchar), SUM(Case

how to obtain a list of schemas in intersystems cache?

可紊 提交于 2019-12-10 15:05:38
问题 I'm connecting to a Caché database using the ODBC driver, and I want to do a query to obtain a list of schemas. In Microsoft SQL Server I can use a query like this: SELECT * FROM INFORMATION_SCHEMA.SCHEMATA How can I do this in Caché? I'm also using ADO.NET schema collections, but the schemas don't seem to be available there. 回答1: The schema %dictionary has the tables you are looking for. You could select from %dictionary.compiledclass 来源: https://stackoverflow.com/questions/12823127/how-to

Intersystems Cache - Can Python be used to directly access a global or only classes exposed as sql tables?

為{幸葍}努か 提交于 2019-12-08 11:33:51
问题 Can the python interface be used to directly access and iterate through an intersystems cache global, or does python simply expose the same "tables" I see when I use a linked server or ODBC Connection? 回答1: If you want to directly access globals you can create a stored procedure that will do so. You should consider the security implications before you do this - it will expose all data in the global to anyone with ODBC access. Here is an example of a stored procedure that returns the values of

Intersystems Cache - Maintaining Object Code to ensure Data is Compliant with Object Definition

自作多情 提交于 2019-12-08 04:09:01
问题 I am new to using intersytems cache and face an issue where I am querying data stored in cache, exposed by classes which do not seem to accurately represent the data in the underlying system. The data stored in the globals is almost always larger than what is defined in the object code. As such I get errors like the one below very frequently. Msg 7347, Level 16, State 1, Line 2 OLE DB provider 'MSDASQL' for linked server 'cache' returned data that does not match expected data length for

Get GLOBALS similar to “Global Search Mask” Intersystems Cache

醉酒当歌 提交于 2019-12-08 03:49:34
问题 I can use VisM now to execute Intersystem Cache Objectscript through vb.net 'open the connection AxVisM1.Connect("CN_IPTCP:127.0.0.1[1972]") 'set namespace to livedata (for formal namespaces, use the @ symbol) AxVisM1.NameSpace = "LIVEDATA" 'okay, so kunin mo na si GLOBALS... 'set value to nothing muna AxVisM1.VALUE = "" 'next, get mo yung value via this syntax AxVisM1.Code = "Set VALUE=$GET(" & theGlobals & ")" 'execute AxVisM1.ExecFlag = 1 'close the connection AxVisM1.DeleteConnection()