I need to start doing unit testing for some of my code.
Why does it delete the unit testing class from Cache when I run the test?
Is there a way to turn this off?
InterSystems Caché is a multi-model DBMS and application server. See more details here.
I need to start doing unit testing for some of my code.
Why does it delete the unit testing class from Cache when I run the test?
Is there a way to turn this off?
Class User.samplexlsconversion Extends (%Persistent, %Populate) [ Owner = {_PUBLIC} ]{
Property name As %String;
Property DOB As %Date;
Property address As %String;
Property PhoneNumber As %Numeric;
Property BloodGroup As %String(DISPLAYLIST = "", VALUELIST = "A A- B B- O");
ClassMethod ExtractXls()
{
Set file=##class(%Library.File).%New("C:\Users\Ponnumani\Desktop\Ponnumani Tasks\file.csv")
Do file.Open("WSN")
Do file.WriteLine("""Name"",""Address"",""Phone Number"",""Blood Group"",""Date""")
s id=""
f {Is there a quick way to see if an SSL/TLS configuration name is valid, short of switching over to %SYS and checking Security.SSLConfigs:Exists?
InterSystems Data Platform includes utilities and tools for system monitoring and alerting, however System Administrators new to solutions built on the InterSystems Data Platform (a.k.a Caché) need to know where to start and what to configure.
This guide shows the path to a minimum monitoring and alerting solution using references from online documentation and developer community posts to show you how to enable and configure the following;
Caché Monitor: Scans the console log and sends emails alerts.
System Monitor: Monitors system status and resources, generating notifications (alerts and warnings) based on fixed parameters and also tracks overall system health.
Health Monitor: Samples key system and user-defined metrics and compares them to user-configurable parameters and established normal values, generating notifications when samples exceed applicable or learned thresholds.
History Monitor: Maintains a historical database of performance and system usage metrics.
pButtons: Operating system and Caché metrics collection scheduled daily.
Remember this guide is a minimum configuration, the included tools are flexible and extensible so more functionality is available when needed. This guide skips through the documentation to get you up and going. You will need to dive deeper into the documentation to get the most out of the monitoring tools, in the meantime, think of this as a set of cheat sheets to get up and running.
Hello.
There is a way to install and try Cachè 2018.1 on Ubuntu 16.04 distribuition or it's necessary use Red Hat/Suse distribuition to try Cachè on Linux?
Hi Community,
I have to make a daily task (Job) which will run (7 am to 7 pm) in a day at an interval of 3 hours. Timings are as (7:00 am, 10:00 am,13:00 pm,16:00 pm,19:00 pm). But at each time when task will run i have to set a variables as per below condition
Sample:
1) If task run at 2019-03-19 07:00 am in morning
I have to set two variables (start and end) whose value will become like this
(set starttime= 2019-03-09 07:00:00.00 and set endtime=2019-03-09 10:00:00.00)
2) But if task run at 2019-03-19 10:00 am in morning, the value should change as per below
Hi all,
Lets imagine that there's a process that locks an entry of a gived domain, in my example the ID 2 of the table User.tApplications and using an exclusive lock. Additionally the error handling is managed by a $ETrap routine wich will look for error data in order to log it
Set $ETrap = "Do Err1^ErrRoutine"
Set obj = ##class(User.tApplications).%OpenId(2,"4",.errors)
If ($System.Status.IsError(errors){// Error: ERR_PESSIMISTIC_LOCK Set $ECode = <MyerrorCode>}When a second process try to do the same action will cause an error informing that there's a lock (that is ok)
Hi community,
I have a rights problem when giving a user permission to perform some select queries on particular tables. So I have created a user with the following rights.
So this all works well. No problem so far. But the customer is using a program where you can easily build visually the query by selecting the table, choose the right colums etc. So the problem we have is when I give the user the Role %All the tables are shown.
Can I apply a custom resource to a Management Portal page through code, using the method or global? The documentation only shows the manual mode: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_rsrcs#GCAS_C181701
Or export the settings already saved.
I have a cache client trying to call a web service using SOAP version 1.2. We receive a SOAP error with the following text:
COD>w ##class(DBMS.Tools).DecomposeError(%objlasterror)
ERROR #6248: SOAP response is a SOAP fault: <Fault><Code><Value>s:Sender</Value>
<Subcode><Value>a:ActionMismatch</Value></Subcode></Code><Reason><Text xml:lang=
"en-US">The SOAP action specified on the message, '', does not match the HTTP SO
AP Action, 'siad.tpic/ITpicDefaultService/Audit'. </Text></Reason><Detail><a:Pro
blemHeaderQName>a:Action</a:ProblemHeaderQName></Detail></Fault>
This code snippet is an example of a CSP page that has a dynamically reloading table:
Hi All,
Can any one know how to change the font style as Italics in Terminal
Hi Community!
There are two general ways to execute arbitrary SQL in serverside ObjectScript code: EmbeddedSQL and ObjectScript SQL a.k.a. Dynamic SQL.
E.g. if we want to get the value of the property of instance with a certain ID using SQL we can do:
&sql(SELECT Name INTO :name FROM Sample.Person WHERE ID=1)
write nameSame result with %SQL.Statement:
set rs=##class(%SQL.Statement).%ExecDirect(,"SELECT Name as name FROM Sample.Person where ID=1")
do rs.%Next()
write rs.nameLet's imagine you have only SQL. You need some table where you should increment value in some property when you update this line.
We have the table
CREATE TABLE "test" (
"identifier" VARCHAR(200) NOT NULL,
"value" INTEGER,
PRIMARY KEY ("identifier")
)Hi,
what is reason of this error (Not all parameters bound/registered ). this is not happening consistently.
those are class method parameters
Query GetWorkItemsByEncounterID(encounterID As %Integer, userId As %Integer, IsSuperOrDev As %Integer = -1, facilityAccessListCSV As %String(MAXLEN=32000), locationAccessListCSV As %Library.String(MAXLEN=32000), skipReferralFilter = 0) As %SQLQuery [ SqlName = spGetWorkItemsByEncounterID, SqlProc ]
After compilation of routine .int file is not generated and toggle breakpoint is also not visible for that routine. It is showing error #5001 Editing of INT file is not allowed. How can I resolve this ?
Just wondering an Insight in the difference between these two indexes
IdKey / PrimaryKey
=================
Property Identifier As %Integer
Index Index1 on Identifier [Idkey]
Index Index2 on Identifier [PrimaryKey]
What's the difference?
1. If I don't have Index1 and only have Index2, then cache does still make its own id.
So how and why do I ever use the PrimaryKey. In Joins ??
Table1.Identifier = Table2.Identifier instead of Table1.Id = Table2.id ??
But I can still use Table1.Id = Table2.Id as cache still made one ID field
So where is PrimaryKey useful in cache?
Hi
Just curious to know about the pros and cons of Parent/Child Vs One/Many.
We do use a bit of both.
One big reason we use Parent child is we feel if we delete one global, it gets rid of all child data too and all parent child data is stored in one global. Much easier to manage.
I know it's late, but I really love the advent of code theme each year to find some project ideas to go out and code something and push myself.
I had the intentions of completing the AOC 2018 before the new year, but I've got 2 young kids (1yo and 4yo), so most nights I just want to sleep.
I've been looking at this on my half hourly commute each day before and after work.
So whilst doing this, I found not many people had posted what they had done and in previous years.
I have one abstract class and several subclasses. All share one data/id global.
How can I get concrete class name from id (without opening the object)?
What I have so far:
write $p($lg(^DATAGLOBAL(<id>),1),"~",*-1)It does the job, but is there a more official way?
I have a problem,ExtentSize,Selectivity etc is stored in class definition.
I have multiple namespaces with globals maped and only one class definition for All, for example Orders.
Order definition is only one,mapped to main namespace,but in different namespaces have different ExtentSize etc.
Here's a simple indirection snippet. It fails with <UNDEFINED> error and I'm not sure why.
ClassMethod ind()
{
kill info
set active = 1
set reactive = 2
for i="active","reactive" {
set info(i)= @i
}
zw info
break
}
I'm getting this exception: <UNDEFINED>zind+5^test.Client.1 *active
In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:
I'm connecting to a remote device using TCP. It has a binary protocol.
set host = ""
set port = ""
set io = $io
set device = "|TCP|7000"
set timeout = 2
open device:(host:port:"M")
use device:(/IOT="RAW")
read string:timeout
use io
zzdump string
The problem is when reading from it, I get a 0A (also known as 10 or \n or linefeed) byte, which terminates the read.
Expected output:
0000: 42 00 7B 0A 11But I get this output:
0000: 42 00 7BHow can I fix that?
Some additional info:
I have an existing table, and I've added an array property to it that I need to populate.
The issue is that I can only use SQL to insert into the table due to access reasons.
For example:
Class Package.Tables.Person Extends %Persistent
{
Property Name As %String(MAXLEN = "");
Property Address As Array of Package.Datatypes.Address;
}
Class Package.Datatypes.Address Extends %SerialObject
{
Property AddressType As %Integer;
Property StreetAddress As %String(MAXLKEN = "");
}
So the projected tables are:
Package_Tables.Person
Package_Tables.Person_Address
I am taking over a production system that had some HSLIB and other database routine and class files modified. However, I do not know what was modified .
I developed a routine that allows me to load each database in our production instance and compare it against a default instance using the SIZE attribute. This allowed me to generate a list of files where the .INT file size in production does not match the file size in the default instance. However, doing a spot check of the .cls or .mac files indicates that in some cases these files are identical, just the intermediate files are different.
I try to create a column with computeonchange.
Its works with CREATE TABLE sql command, but if i use ALTER TABLE ADD COLUMN sql command this computeonchange doesn't works.
any reason why?
example:
CREATE TABLE MyStudents ( Name VARCHAR(16) NOT NULL, surname VARCHAR(16))
alter table MyStudents add column fullname Varchar(50) COMPUTECODE { SET {fullname}={Name}_ "?" _{surname}} COMPUTEONCHANGE (Name,surname)
insert into SQLUser.MyStudents (Name, surname) values ('name1',null)
update MyStudents set name = 'name' where name = 'name1'
this not updates fullname column value....
Hi,
When Creating a custom security role, what privileges do I need to add to it, in order for the users that I grant him the role, to be able to use
dynamic SQL to perform read only queries on all tables in a namespace?
I have a security role, that contains the %Service_SQL privilege,
And yet when I connect to a terminal and try to run an SQL query using dynamic SQL , I get a "user is not privileged for the operation" error.
reading the documentation , I understand that %Service_SQL privilege privilege is not enough, but I don't understand what privilege to add,
I am reviewing some code where the % sign has been used liberally to name arrays that are worked on by different methods within the same class. Apparently it is not good practice to name variables with a "%" sign as the first character because this could overwrite other similarly named variables from other developers, including ISC! Is there another way to make a variable public ?
I'm getting this compilation error:
Kompilieren der Klasse digi.packet
FEHLER #5002: Caché-Fehler: <FUNCTION>zLockUse+5^%ExtentMgr.GlobalRegistry.1
> FEHLER #5030: Während der Kompilierung von Klasse 'digi.packet' ist ein Fehler aufgetreten
when importing one of my classes on the production server into one particular namespace: