Caché

Syndicate content 116 

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 name

Same 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.name

Last answer 7 March 2019
+ 1   0 3
0

comments

232

views

+ 1

rating

Hi,

I am trying to create a user role which shall allow users the access to only one specific namespace in an Ensemble system. I´ve startet creating the namespace with a database (with own ressource and no public access). In the second step I´ve created a role by copying it from the predefined role %Developer and assigned the ressource of the created database. After that i´ve created a user and assign him to the created role.

When trying to login to ensemble - the management portal comes up but the Ensemble tab is showed deactived. Looking in the audit protocoll I am getting the typical PROTECT notifications telling that user is not permitted to access a protected global in the cachelib database

Last answer 7 March 2019 Last comment 7 March 2019
0   0 2
48

views

0

rating

I am under the impression that inside HealthShare you can Services, Processes, and Operations. The service takes incoming data, the processes can process that data, and then the operations can send that data out.

 

I am curious if anyone has any experience, guides, or advice on how I can send data to a service using a Java application. I intend for the data to be in XML format. I am also curious if I succeed at picking up the data in the service, how I send the data back to the Java application using an Operation.

 

As of now I am attempting to get this to work on a local environment.

 

Any input is appreciated,

Thank you,

Jess Farmer

0   0 2
0

comments

52

views

0

rating

Let'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")
)

Last answer 6 March 2019 Last comment 6 March 2019
+ 1   0 4
109

views

+ 1

rating

Our lab system is now sending DSC segments in large Pathology results in the ORU message that is followed by a partial continuation message with only MSH and OBX segments.  the  pointer is in the MSH;14 in the subsequent message.  I believe the goal is to concatenate the first and second message but imagine this will require some custom functions which I have not done much of.  Anyone already tackled this by chance? 

Initial message

Last comment 6 March 2019
0   0 1
0

answers

73

views

0

rating

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?

2. If I declare Index1 , I am not able to have any Bitmap indexes [Cache throws an error on compilation saying I have an Idkey index]

 

Last answer 5 March 2019 Last comment 6 March 2019
+ 1   0 6
117

views

+ 1

rating

I successfully got everything in this guide to work:  https://community.intersystems.com/post/ensemble-rabbitmq-java-client-qu...

I am now using the information I gained from this guide along side with this guide:

https://www.rabbitmq.com/tutorials/tutorial-one-spring-amqp.html

 

I am running into an issue though. In the RabbitMQ guide I just posted, they have a "Receive message" functionality. I use that alongside with the SendMsg from Ensemble method in the InterSystems guide. The issue I have is the message I receive looks like "[B@2c421093(byte[21])" instead of "Hello from Ensemble!"

Last answer 4 March 2019 Last comment 5 March 2019
0   0 2
65

views

0

rating

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'd found this helpful when I've got stuck for ideas, so I thought I would post what I've done (that works) and see how others might of implemented a solution.

A full explanation of Day1 part 1 can be found at: https://adventofcode.com/2018/day/1 and the input can be found

at: https://adventofcode.com/2018/day/1/input

Last comment 4 March 2019
0   0 2
45

views

0

rating

ˮ This is one of my articles which was never published in English. Let's fix it!

Hello! This article is about quite a practical way of developing InterSystems solutions without using the integrated tools like Studio or Atelier. All the code of the project can be stored in the form of "traditional" source code files, edited in your favorite development environment (for example, Visual Studio Code), indexed by any version control system and arbitrarily combined with many external tools for code analysis, preprocessing, packaging and so on

Last comment 2 March 2019
+ 6   5 3
721

views

+ 6

rating

Hi,

  I have a permanent job opportunity which would ideally suit someone from Europe who want's to experience the UK (initially London), the requirements are fluent in Cache Objects, SQL, XML, Integration,  English Language and be self motivated with a desire to experience London.

  I am NOT a recruitment agency and will offer personal help in relocation and culture differencies to handle moving countries. 

  I do not offer a relocation package but will offer advice, guidance and help in relocation.

  For further details and a chat, please send your CV and salary expectations to recruitment@hulatech.com

 

      Regards

 

        Paul

 

 

Last comment 2 March 2019
0   0 2
305

views

0

rating

HI

We have a custom login page. (Right off the documentation ). It works perfectly.

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

<page xmlns="http://www.intersystems.com/zen" title="">
  <loginForm id="loginForm" >
    <text name="CacheUserName" label="User:" />
    <password name="CachePassword" label="Password:" />
    <submit caption="Login" />
  </loginForm>
</page>

Issue is that we want users to login from the email id that has been saved when we defined the users on the Security. Users page on mgmt portal and not from the userid assigned to them.

What we had thought is to fetch the emailid from the form.

Run a method on submit to fetch userid from the email given and set the returned value as CacheUserName and submit

Last answer 2 March 2019
0   0 1
0

comments

64

views

0

rating

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.

Last answer 1 March 2019 Last comment 2 March 2019
0   0 3
54

views

0

rating

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:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab Workflow
  • Continuous Delivery
  • GitLab installation and configuration
  • GitLab CI/CD

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:

  • GitLab Workflow - a complete software life cycle process - from idea to user feedback
  • Continuous Delivery - software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. It aims at building, testing, and releasing software faster and more frequently.

Last comment 1 March 2019
+ 5   0 4
991

views

+ 5

rating

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 11

But I get this output:

0000: 42 00 7B

How can I fix that?

 

Some additional info:

  • read completes in 0.1 seconds despite 2 seconds timeout.
  • $zb contains the value of 0D
Last answer 28 February 2019
0   0 1
0

comments

59

views

0

rating

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

Now via ObjectScript it's as easy as

Last answer 28 February 2019
0   0 1
0

comments

49

views

0

rating

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. 

What I would like to do is export these files (.cls, .int, .mac) to XML, placing the files from production in one folder and the files for the default instance in another. After I can use something like BeyondCompare to better identify what has changed. 

In my code I currently use the following to get information about a routine where p = the name of the routine

Last answer 27 February 2019 Last comment 21 February 2019
0   0 5
130

views

0

rating

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....

but it's works with a create table command.

CREATE TABLE MyStudents (   Name VARCHAR(16) NOT NULL,   surname VARCHAR(16),   fullname Varchar(50) COMPUTECODE { SET {fullname}={Name}_ "?" _{surname}} COMPUTEONCHANGE (Name,surname)  )

 

 

0   0 2
0

comments

38

views

0

rating

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:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab Workflow
  • Continuous Delivery
  • GitLab installation and configuration
  • GitLab CI/CD

In the first 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.

In the second article, we covered GitLab Workflow - a complete software life cycle process and Continuous Delivery

Last comment 26 February 2019
+ 2   0 3
608

views

+ 2

rating

Greetings, InterSystems community!

I am pleased to announce that the web terminal project, Caché WebTerminal version 4 gets its release! After long period of enhancing this web application from 2013, it came to the version 4, which features major stability and security improvements, intelligent autocomplete and syntax highlighting, convenient SQL mode and a lot of other useful features.

The goal of this article is to spread the knowledge about this project over the InterSystems community.

Last comment 26 February 2019
+ 15   2 8
1674

views

+ 15

rating

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 can't add specific tables in the "SQL Tables" section of the role definition, I need all the tables to be accessible.

this the documentation I mentioned:

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

Regards,

Nael

Last answer 25 February 2019 Last comment 26 February 2019
0   0 4
137

views

0

rating

Hi, I have a CSV file with a list of 5000 records in the following format

Name, Acc, division

Eric, 1234, 567

John, 1235, 987

Peter, 3214, 879

I just want to copy the Acc, division to a global so eventually the global would be like the following:

^People("Customers", "Acc.division")

Can you advice on how I can perform this from the terminal? This is a one time task. I want to read all the values from the csv file and insert them into the global

Regards,

Eric

Last answer 26 February 2019 Last comment 19 November 2018
0   0 6
239

views

0

rating

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 ? 

Last answer 24 February 2019 Last comment 25 February 2019
0   0 5
291

views

0

rating

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

Last answer 22 February 2019 Last comment 24 February 2019
0   0 3
75

views

0

rating