Hello, guys.
Say I have two horologs or timestamps, how can I compare them? I know that just time1 > time2 doesn't work because it will compare them as strings which is not correct.
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
Hello, guys.
Say I have two horologs or timestamps, how can I compare them? I know that just time1 > time2 doesn't work because it will compare them as strings which is not correct.
I have been using the query below and it was working fine but now it's giving a SQL error. There were no changes made that could cause this to stop working. There is no Field 'APPLICATIONID' in the table.
QueueSQL=select distinct (convert(char(5),SkillsetID)+'='+Skillset) from iagentbySkillsetStat where ApplicationID > 10000 QueueMappingSQL=SELECT DISTINCT (convert(char(5),SkillsetID)+'='+Skillset), SkillsetID FROM iagentbySkillsetStat iagentbySkillsetStat WHERE (iagentbySkillsetStat.ApplicationID>10000)
DB- Intersystems Cache
Error details for the log files are below.
14/09/2016 11:20:05 a.m.
What are the difference between $ and $$ symbols using macro.
Wir suchen für ein Unternehmen unserer Firmengruppe
eine/n ERP System Developer / Programmierer/ Software Entwickler
Unser Partnerunternehmen ist ein international agierendes Handelsunternehmen mit Sitz in der Nähe von Wien.
Der zukunftsorientierte IT Bereich entwickelt intelligente innovative Lösungen für die Vielfalt der Herausforderungen, die sich täglich stellen. Die Fülle der abwechslungsreichen Aufgaben und Projekte, sowie die Art und Weise wie zusammengearbeitet wird, bietet hervorragende Wachstums- und Entwicklungschancen.
EnsPlus, the Caché Objectscript plugin for Visual Studio, has now been upgraded to support all versions of Visual Studio 2015, including the free Community edition.
UPDATE: Found a reason in my code why this could be occurring. Still it would be interesting to hear what people come back with.
Consider the following MERGE statement.
I want to use the Regex Matcher to strip HTML tags, but I get a REGEX error. Can anyone explain what I'm doing wrong?
set htmlSnippet = "<h1>Hello</h1>"
set regex = ##class(%Regex.Matcher).%New()
set regex.Text = htmlSnippet
set regex.Pattern = "<[^>]*>"
set plainText = regex.ReplaceAll(" ")
write !,plainText
Hello, guys.
I need to find all web files, get their content in UDL format and to be able to export them. And, vice versa, to be able to import them in udl format.
I know that they are located in CSP folder. However, is there any way to do this using COS functions?
Hello community!
Is there any method/property/way in Caché to obtain something like unique identifier for installed Caché system? The idea is to get the identifier that will differ on any other installation/machine/etc, but will forever remain the same for the current installation, even if $zv changes (in case of update) or any data is removed from the database.
Hi -
I have 3 classes: "Class A" has a property X, "Class B" has a property which is a Class A, and I have a "Class C" which has a property of a Class B.
Class A definition
Class USER.ClassA Extends %Persistent
{
Property Propx as %String;
}
Class B definition
Class USER.ClassB Extends %Persistent
{
Property Record as USER.ClassA;
}
Class C defintion (which is where I'm having my problem)
Class USER.ClassC Extends %Persistent
{
Property BRecord As USER.ClassB;
Property ARecord As USER.ClassA [ Calculated, SqlComputeCode = { ????? }, SqlComputed ];
Method ARecordGet() as USER.ClassA
{
quit .
write "5apples" + "7 orange" //Ans :12
Values are string , why add numeric value . its an error or correct . please tell me.
Is there an API I can call to determine the size of a routine in a CACHE.DAT file so that I don't have to directly reference the ^ROUTINE global?
Please Explain "$h"
Process-private Globals can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:
Here's the class:
/// Stores unique identifiers
Class Utils.Pool Extends %Persistent
{
Property Value As %String;
Index IDKEY On Value [ IdKey, PrimaryKey, Unique ];
Method %OnNew(Value As %String = "") As %Status [ Private, ServerOnly = 1 ]
{
Set .Problem: I have a REST broker, and if I hit a code block, which does IO redirection, the REST reply becomes broken in one of the following ways:
Consider the following REST broker:
Class A.REST Extends %CSP.REST
{
XData UrlMap
{
<Routes>
<Route Url="/Test/:redirect" Method="GET" Call="Test"/>
</Routes>
}
ClassMethod Test(Redirect As %Boolean = {$$$YES}) As %Status
{
Set str = $TR($J("",4098)," ","1") // Get a string with the length of 4098 symbols
Do:Redirect .Caché Server Pages Version 2016.1.1.108.0
Error Condition The processing of the request was interrupted
CSP application closed the connection before sending a complete response"
<html>
<head>
<title>User input </title>
</head>
<body>
<script language="Cache" runat="server">
r "enter 1ST num",x
r "Enter 2ND num",y
s z = x+y
w z
</script>
</body>
</html>
Hi,
I create a cache class program. Its compile it. But how to run it?
Please send one sample program with output
At the Global Summit several folks had mention that they developed their own production monitor. I am looking to create a monitor similar to eGate that we only display those Services/Processes/Operations that are in trouble, and those Errors that are showing up in the Event Log. Does anyone have any examples of this?
Thanks
Scott Roth
The Ohio State University Wexner Medical Center
Hello Cache experts,
Has anyone tried using Cache object script to check windows service is running or windows service installed or not on same computer or remote computer ? basically i am trying to develop cache program which will check "windows service" running or installed on current computer or remote computer. Based on the status of this windows service, i want to write some business logic in our application. Any suggestions will be more welcome
Hello, guys.
We have recently created a syntax highlighting for COS for Atom text editor. You can find it on https://github.com/intersystems-ru/atom-language-cos
Installation:
~/.atom/packages/ Window: Reload in Command line)It's been few days since the release, so please if you find a bug, let us know through creating an issue or forking and making a pull request.
P.S. After it gets more or less usable, we will use this syntax as a basis for GitHub highlighting for COS.
We are creating a package (written in Caché Object Script) that will provide access to an external DB (MySQL). Because applications that use our package will be run from machines with various, potentially unexpected, operating systems, we’d like to establish a connection to the external DB without using DSNs (we’ve heard that setting up DSNs on certain non-Windows machines can be cumbersome and problematic).
Does anyone know of way to create a connection to an external DB without using a DSN?
Several years ago, long before Developer Community Portal was launched, I published a series of Caché tricks at one of Czech web sites. In this article, I’m posting translated version of one of them.
Suppose you, or someone else created a useful method or routine, that was producing some computation that you’d like to benefit from, but the routine was writing output to process principal device.
You would like to use the data, but you need it not written to a device, but assigned to a variable. And, for any reason, you can’t modify the code. What can you do?
While Studio and Atelier are useful development interfaces, there are occasionally situations where a quick edit needs to be made to code and only terminal access is available. A useful set of tools to do this are the zload, zprint, zinsert, zremove, and zsave commands. These are abbreviated to zl, zp, zi, zr, and zs respectively. While each of these commands has its own page in documentation, this article will synthesize that information with examples to provide instruction for their combined use.
I have the following problem:
So how do I force classes with method generators to recompile when "u" qualifier is present?
Hello, everyone!
I opened one project and there I found such lines as
The problem is I can't go to their definition and find them in documentation. It says that they don't exist on the server. However, the project works and these routines execute.
How can I import them into my project?
Hello, guys!
I want to get access to the folder where all files of the namespace are stored using COS. I found a way to get access to class files and found a folder where all csp, html, css etc files are stored.
However, is there any folder which contains all files(even .mac and .int)?
Or, probably, there is a method which gives all files content?
I've been trying to write a method to compare two local variables, which may be arrays, for "equality" - that is, to see if they have all the same subscripts (if they're arrays) and values. This is the best I've come up with so far - are there any better/simpler approaches out there?
/// Returns true if arrays <var>first</var> and <var>second</var> have all the same subscripts and all
/// the same values at those subscripts.Hello!
In Caché there is a way to print all current variables using write command without arguments:
But is there a way to get a list of this variables? I am looking for something that would return value like $LB("Einstein", "Mozart") for this case.
Thanks!
Hi!
Here is the question in Russian Forum regarding roots extracting.
In Caché ObjectScript we use exponentiation operator (**) to raise an exponent to power. F.e. let's raise 3 to power of 3:
USER> write 3**3 27
And we use the same operator to extract the root.
USER> write 27**(1/3) 2.999999999999999963
And 2.999999999999999963 is not 3, obviously.
How to extract roots properly in Caché ObjectScript?
I am testing application code and want to simulate error conditions.
I am trying to use the following to define a custom error with a class method.
$SYSTEM.Status.Error($$$GeneralError,"Any text here")
My class method code looks like this....
Class compile fails because the $$$GeneralError is unknown.
TEXT: set RunStatus=$System.