Hi All,
Can any one know how to change the font style as Italics in Terminal
InterSystems Caché is a multi-model DBMS and application server. See more details here.
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:
In the previous article, we covered Git basics, why a high-level understanding of Git concepts is important for modern software development, and how Git can be used to develop software. Still, our focus was on the implementation part of software development, but this part presents:
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:
In my routine when I call set filestream.FileName = filename, I get an error
"cn_iptcp://localhost:56773/USER/%Stream.FileBinary.1.INT" does not exist on the ServerI successfully instantiate the %Stream.FileCharacter object. 'filestream' value is '1@%Stream.FileCharacter'. But when I debug the code, the step where I try to set the file name fails.
The port number for local host looks good for my current instance. I have tried a few variations, such as using the method FileNameSet(). But this did not work either.
For a solo developer developing web applications what will be the best technology to use IRIS or Studio with cache database and containers for deployment
Is it just me or is the sync mechanism way too slow and too trigger happy to be used for large projects? It keeps "Caching for server connection" which takes a good five minutes!
Has it been tested with a large number of classes and CPSs? I have about 2000 of each.
Hello,
I'm trying to convert JSON response to object in cache 2010.
My Code is bellow:
set sc = ##class(%ZEN.Auxiliary.jsonProvider).%ParseJSON(resptext,,.pObject,1)
my JSON response
{"access_token":"DSAFFDSGFDGTRHTRHTRH","in":"2522","refresh":"","scope":"send","token_type":"Bearer"}
the result : "9@%ZEN.proxyObject"
I have a date in this format: "YYYY-MM-DD HH:MM:SS+HHMM" how can I convert it to UTC?
write $zdth("2018-02-01 00:00:00+0600",3,5)
>64680,0
write $zdt("64680,0",3,5)
>2018-02-01T00:00:00+03:00
As you see, timezone is lost. Docs for $zdth in timeopt (5) state: Specify time in the form "hh:mm:ss+/-hh:mm" (24-hour clock). The time is specified as local time. The following optional suffix may be supplied, but is ignored: a plus (+) or minus (–) suffix followed by the offset of local time from Coordinated Universal Time (UTC)
SetIdentityInsert call controls the ability of the user to specify a value for the IDENTITY property when saving a new object, a value for the IDENTITY column or an explicit ROWID value in an SQL INSERT. If IDENTITY_INSERT is false and the user specifies an explicit IDENTITY or ROWID value when saving a new object or inserting a new ROW then an error condition is reported.
Setting takes effect immediately and lasts for the duration of the process or until SetIdentityInsert is called again.
My question is how can I change this setting system-wide?
(Originally posted by @Sascha Kisser on March 11, 2014) The following 2 classes are a component for a webcam, and a ZEN page that incorporates it. The webcam can take a snapshot and save it to Caché:
What is the best way to learn mirroring? Are there any videos on learnings at InterSystems community?
I am new to Intersystems Cache, so please bear with me. We are using HealthShare 2013.1.
I have a routine to compare databases from separate instances where I want to ignore values that begin with %sqlcq. I thought this would be easy with pattern matching operator '?' but it is proving difficult and it seems to be because of the percent character.
For example:
set x = "%sqlcq.something.value.foo"
#;does not evaluate as true.
if x?1P1"sqlcq" {write "valid"}
set y="sqlcq.something.value.bar"
if y?1"sqlcq".E {write "valid"}
valid
if x?1"sqlcq".E {write "valid"}
I have a requirement to use DES encryption, but looking at the document found no support. I want to know how to solve it.
Hi,
is anyone using Powershell to access Caché terminal in non-english systems?
I'm trying to access using: csession INSTANCE
But from the beginning it fails to represent spanish characters like ñ,...
It doesn't recognize up-down cursor keys to see previous commands...
Any idea?