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.
Environment: Cache for Windows (x86-64) 2015.2.2 (Build 811U) Thu Mar 3 2016 12:55:48 EST [HealthShare Modules:Core:14.01.351
When try the following to send back SOAP Fault, is the following correct way?
Set fault=##class(%SOAP.Fault).%New()
Set fault.faultcode=$$$FAULTServer
Set fault.faultstring="Processing Error"
Set fault.detail= "Error on server"
Do ..ReturnFault(fault)
Got the error
| ERROR #5659: Property '%ZHSLIB.Audit.LogParticipant::Log' required |
| Stack: |
|
Here's an easy one for you; before I spend another hour looking for the answer, how do you convert %ArrayOfDataTypes to an array (that could, say, fit into the %session.Data array, or maybe just some array named info()), and of course back again?
NS>s aodt=##class(%ArrayOfDataTypes).%New()
NS>w aodt.SetAt("lcavanaugh","username")
1
NS>w aodt.SetAt("organization","coolcompany")
1
NS>w ##class(%ArrayOfDataTypes).BuildValueArray(aodt,.array)
<LIST>zBuildValueArray+1^%Library.ArrayOfDataTypes.1
aodt must be serialzed. What?
NS>zw array
NS>
Hi everybody,
My name is Sérgio Fernandes and I'm from Brazil.
I need to get the size of file that the user wants to upload in my application.
I'm getting it name with %request.GetMineData("fileName").FileName, but not found it at Ensemble documentation how would i get the size of file.
My version is Ensemble 2013.1.6.950.0 and I'm doing it at csp.
Thaks
I try to run the cmd command in the studio terminal, but i am getting the <NOTOPEN> Error.
Even ZF(-1) also not working. Any help, Please!!!
Note: i restart the Cache instance service with full privilege
Code:
Set Path="mkdir E:\Sample\New"
Open Path:"QR":10
Error:<NOTOPEN>
This command working on my PC, but on server throws error.
Many Thanks
Hello,
I'm sending http request through %Net.HttpRequest and I have html page in response. Is there any built-in tool for beautify html for printing in terminal?
Thanks.
Can somebody explain this behaviour of Cache (and many other calculating machine as well) :
WRITE 1/3*12
4
WRITE 1/3*5
1.666666666666666667
W 1/3*18
5.999999999999999999
W 1/3*21
6.999999999999999999
W 1/3*24
7.999999999999999999
How can we make more occurate caculations in Cache ?
There is an interesting discussion in the Russian forum going.
What is the best solution for the function which returns the max for the set of parameters?
From the listed solutions I like this one:
ClassMethod max(args...) {
for i=1:1:args { s max(+$g(args(i))) = i }
s i="", max=$o(max(i),-1, i) Q $lb(max, i)
}Hi,
I am using iknow text categorization to classify texts. I have 11 medical articles as my training set. Here is part of the source code:
ListerAndLoader
SET domId=domoref.Id
SET flister=##class(%iKnow.Source.File.Lister).%New(domId)
SET myloader=##class(%iKnow.Source.Loader).%New(domId)
UseLister
SET dirpath = "D:\iKnowTestCase\SmallDataBase\Medical"
SET stat = myloader.SetLister(flister)
SET stat = myloader.ProcessList(dirpath,$LB("txt"),0,"")
IF stat '= 1 {WRITE "The lister failed: ",$System.Status.DisplayError(stat) QUIT }
TrainingSet
SET tTrainingSet = ##class(%iKnow.Filters.Random
This post is the direct result of working with an InterSystems customer who came to me with the following problem:
SELECT COUNT(*) FROM MyCustomTableTakes 0.005 seconds, total 2300 rows. However:
SELECT * FROM MyCustomTableTook minutes. The reason for this is subtle and interesting enough for me to write a post about. This post is lengthy, but if you scroll to the bottom I'll write a quick summary, so if you've gotten this far and think you've already read enough, scroll to the end to get the main point. Check for the sentence in bold.
There is consideration to take when creating your
I was wondering how you could take an exported obj and have it converted to an int/mac.
Here you have an easy way to write and execute COS code from your unix scripts. This way one does not need to write routines or even open Studio or Atelier. It can be an option for simple and small actions for instance things like installation tasks or compiling.
See sample bash script (compile.sh) to compile classes:
#!/bin/bash ##################################################################### # Script to compile classes # $1 = NAMESPACE # $2 = ClassName # # For example: # ./compile.sh "SAMPLES" "Sample.Person" #####################################################################
With a routine like this one, you can quickly calculate how many lines of code you are working with. And it is not only for routines, it works for classes because remember that classes generate routines !
Here you have the routine source code:
LinesOfCode ;
new SQLCODE,tRoutine
set tTotalLOC = 0
&sql(DECLARE ROUTINES CURSOR FOR
SELECT NAME
FROM %Library.RoutineIndex
WHERE TYPE = 'MAC'
ORDER BY NAME)
&sql(OPEN ROUTINES)
&sql(FETCH ROUTINES INTO :tRoutine)
while (SQLCODE=0)
{
write !,$j($i(tCount),5),": ",tRoutine
set tLOC =Hello, guys.
I found one interesting moment in Cache Object Script. It doesn't have(or at least I didn't find) trimming function. By trimming I mean if a string has some whitespaces/tabs/carriage returns from very beginning or/and from very right, this function removes them.
I have found several workaround ways.
1. Using Cache Basic
ClassMethod TrimCacheBasic(str As %String) As %String [ Language = basic ]{Return Trim(str)}2. Using SQL
ClassMethod TrimSQL(str As %String) As %String
{
set tStatement = ##class(%SQL.Statement).%New()
set tSC = tStatement.%Prepare("SELECT TRIM(?)")Have you tried $Translate for date conversion?
USER>write $Translate("Dd.Mm.WwYy","WwYy-Mm-Dd","2015-08-02")
02.08.2015
Stolen from Russian forum and Alexander Koblov.
Hello,
we build a COS-application which includes classmethods for running a simulation calculation (differential equations by Runge Kutta procedure) which runs well but needs too much time. This is embeded in Cache Server Pages and we tried already to start the simulation as a JOB to avoid the CSP-timeout.However the Job needs of course also too much time.May be this could be solved by a different strategy to run the simulation calculation by an external Windows -Programm (developed with Delphi).
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.
Für die Entwicklung und ständige Weiterentwicklung der
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.
M ^WORKDELETED(DAYNUM,WKS,ACC,$H,%logname)=^WORK(DAYNUM,WKS,ACC)
Produces output
^WORKDELETED(64165,366,16090404088,"64165,34201","user001")="SOME DATA"
^WORKDELETED(64165,366,16090404088,"64165,34201","user001",0,"LOG")="64163*11:05*user001*64163,39919*~"
<other sub-level nodes omitted>
^WORKDELETED(64165,366,16090404088,"64165,34202","user001")="SOME DATA"
^WORKDELETED(64165,366,16090404088,"64165,34202","user001,0,"LOG")="64163*11:
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 ..BRecord.ARecord
}
}
Wha
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:
- add elements to a pool (ignoring duplicates)
- check if an element exists in the pool
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 ..Value = Value
Quit $$$OK
}
ClassMethod