Beginner

Syndicate content 13 

Hello community; this may seem odd, but I need to know if there's any way we could be using callin functions from a C application without knowing?  e.g. if other developers created some C programs that call in to Caché that we don't realize are running.  Is that possible?  If so, where would I look to see these programs?  Perhaps the server's task manager? 

Thanks --Laura

Last answer 17 October 2016 Last comment 17 October 2016
0 2
169

views

0

rating

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" 
#####################################################################
echo -n "username:"
read username
echo -n "password:"
read pwd

csession HSINSTANCE -U "$1" <<EOFF
$username
$pwd
set status = \$SYSTEM.OBJ.Compile("$2")
h
EOFF

This is the output from the console

Last comment 14 October 2016
0 3
446

views

+ 4

rating

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 = $get(^rMAC(tRoutine,0,0))
        write "("_tLOC_")"
        set tTotalLOC = tTotalLOC + tLOC
        &sql(FETCH ROUTINES INTO :tRoutine)
    }
    &sql(CLOSE ROUTINES)
    write !!,"Total lines of code = "_tTotalLOC

This is the output in a terminal

Last comment 13 October 2016
0 6
417

views

+ 5

rating

Now, let’s say you can’t access the terminal or simply you just rather execute it from a web interface. In this article, I will show you how to execute terminal commands from a simple web page.

For example, in the image below you see how we execute $zv on a webpage:

This is mostly possible due to the XECUTE command in Caché ObjectSCript. This command takes a string as a parameter and tries to execute it. This is the command used from the webpage, to execute what is being passed from the left navigation menu.

This article contains three snippets of code. Each of which corresponds with a separate file. In total, there are three files:

1. Index.csp  (A sample page with two frames)

Last comment 13 October 2016
0 0
4927

views

+ 2

rating

Very new to this side of cache.... 

So, currently in the habit of keeping all users forever, up to over 5000... ? is what if we decided to start deleting old users who have been gone from the company, how would it affect any account level information? notes, payments etc....  Is there any documentation anywhere that would answer this or describe this process or maybe best practices??

Sorry if this seems stupid but i am working on a proof theory for work.

Last answer 11 October 2016 Last comment 12 October 2016
0 2
252

views

0

rating

A beginner’s guide to Exception Handling in RESTful web services. The article gives an example how the various error conditions during processing a service request can be handled.

We expect our client – server communication working in a flawless operational condition, running error free software. But we are prepared to handle exceptions. Are we? So far in the examples of the previous sessions were not. We did not care about exceptions. The result? In any error incident it took ages to figure out what the problem is and more importantly how to fix it.

Remember, REST leans on HTTP. HTTP explicitly defines how error conditions must be handled. HTTP requires to return a status in the response header and optionally supplement it by a human or robot readable error explanation in the message body. RESTful communication is not different

Last comment 6 October 2016
0 7
653

views

+ 2

rating

to dismount/mount a database, use Dismount() and Mount() methods in SYS.Database class available in %SYS namespace.
NB: the database ID is its Directory

You'll find  some examples of how to dismount/mount and check if a database is mounted (Mounted=1) or not (Mounted=0), and quickly see all the attributes of a database (via zwrite

0 2
0

comments

778

views

+ 2

rating

This article gives a brief introduction how a RESTful service consumer and a RESTful service provider exchange data. It is a beginner’s guide. Data is transferred from a consumer to a provider as parameters of the service. Parameters are part of a service request. The result of the service action a response is returned from a provider to a consumer. Both the service request and response are standard HTTP messages. Since HTTP is a flexible standard regarding to the message contents, RESTful services also enjoy the versatility of data transfer methods.

During this session you can learn what options you have, and how to implement those options both at consumer and provider side using Ensemble.

Before you read

You need to hav

0 4
0

comments

2064

views

+ 3

rating

Good Morning and thanks in advance for all replies.  I have created a PowerShell script for backing up CACHE and all related files to be run on a nightly basis.  My script works as long as the Unknownuser has %all access which is not acceptable in our production environment.  I have tried every format I can thank of to get the script to use a specific id with no luck.  How can I get this command to run under a specific id? 

..\bin\cache -s. -U%SYS "##Class(Backup.General).ExternalFreeze() <d:\backup\login.scr" 

 

The file just has

userid`r`n
​password`r`n

`r. For a carriage return and a new line, use `r`n.

 

Last answer 30 September 2016 Last comment 5 October 2016
0 3
327

views

+ 1

rating

NewBie's Corner Session 27 Traversing A Global with $Order Part 1

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Traversing A Global

Perhaps the most difficult concept in Caché/MUMPS is its Global Structure. This session and several that follow it deals with the Global Structure. However, just presenting the material will not guarantee your understanding of it. You must experiment with the data and concepts that are presented.

In this session, we are going to create a small Global of three levels deep, and then show the code to Traverse the Global.

The following code sets up the ^Trans Global and then gives the code to traverse it. I suggest you study the code, experiment with it until you have a good feel for how the Global is structured and how to traverse it

Last comment 4 October 2016
0 10
568

views

-1

rating

NewBie's Corner Session 28 Various Methods to Traverse a Global

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Judging from the number of responses to Session 27 Traversing A Global, developers are passionate about their methods. I am not here to judge the merit of the various methods.

Over the next few pages I will demonstrate a number of methods to Traverse a Global. If you don't already have a favorite they may help you pick one.

I will repeat the method from Session 27 just to have all methods in one post.

There may be variations on these methods and perhaps methods I am not aware of. Feel free to chime in and express your opinion, that is how we all learn.

If you use Caché Objects and Methods with Caché SQL you should never have to worry about traversing a Global, that is the best to my way of thinking

Last comment 4 October 2016
0 8
436

views

+ 2

rating

Cross-origin Resource Sharing (CORS) is one of the basic security features built into browsers. CORS controls accessing resources from a HTML page in domains other than the original domain. It is particularly important for AJAX calls. Since RESTful services can be used as data provider to any AJAX call, you have to be able to control cross-origin access. By default services are not allowed to do CORS. You are going to learn how to enable it for Ensemble RESTful services

0 1
0

comments

775

views

+ 3

rating

NewBie's Corner Session 29 Documentation on the Caché/MUMPS Global Structure

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

This post contains several links to very good documentation of the Caché Globals Structure.

Like I said, "Perhaps the most difficult concept in Caché/MUMPS is its Global Structure."

 

universalNoSQL.pdf - http://mgateway.com/docs/universalNoSQL.pdf

by Rob Tweed and George James

 

Extreme Database programming with MUMPS Globals

http://gradvs1.mgateway.com/download/extreme1.pdf

by Rob Tweed

Last comment 26 September 2016
0 4
226

views

0

rating

NewBie's Corner Session 1 Installing Caché

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Session 1 - InterSystems Inc. allows you to download a single copy of Caché to your personal computer at no cost. This is available from www.InterSystems.com.  It is at this link: https://download.InterSystems.com. You will first need to register yourself with InterSystems. Follow the instructions on how to download the install file. Choose the full version of Caché, not the Client Components.

After you have downloaded the Caché install file, double click on the executable (*.exe), and let it run taking the default answers for all the questions. You will be asked for two passwords, remember these, you will need them later. Your username will be your username on your computer

Last comment 23 September 2016
0 4
590

views

+ 1

rating

This is a detailed guide to develop RESTful services using InterSystems Ensemble. The goal of this guide is to make you understanding the basic concept and building blocks of a RESTful service. The service is going to provide a very basic functionality (a “Hello world!”).

You will learn how to create required components as Ensemble classes, configure the run-time as an Ensemble Production and create a service configuration as a web application

0 4
0

comments

1035

views

+ 3

rating

NewBie's Corner Session: 9 Documentation and books

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

To access your documentation:

Assuming you have installed Caché, (see NewBie's Corner, Session:1),

Click on the InterSystems cube in the Windows system tray, then choose Documentation.

Or – another method you can use to access your documentation:

Assuming you have installed Caché, (see NewBie's Corner, Session:1),

Click on the InterSystems cube in the Windows system tray, then choose Preferred Server,

From the drop down menu choose Add/Edit

Then from the row that has your Server Name, find the Web Server Por

Last comment 22 September 2016
0 4
301

views

0

rating

NewBie's Corner Session 26 Globals and Arrays Part 2

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Globals, Arrays, and Variables Part 2

A thorough understanding of Globals, Arrays, and Variables is foundational for every Caché developer.

Uniqueness of the Caché Global Structure or database

The Caché Database Structure is unique among databases; it was designed and created in the 1960s to be used primarily with HealthCare applications. It has thrived in the Healthcare Industry as well as Financial Information systems and others. It was designed for use in multi-user database-driven applications. It predates "C" and most other current popular languages, and has a very different syntax and terminology

0 1
0

comments

179

views

0

rating

NewBie's Corner Session 25 Globals, Variables, and Arrays Part 1

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Globals, Arrays, and Variables

A thorough understanding of Globals, Arrays, and Variables is foundational for every Caché developer.

A Global may be:

Scalar (a single element), as in a Global Variabl

0 1
0

comments

190

views

0

rating

NewBie's Corner Session 20 Parameters and Status Part I

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Parameters

Parameters are another name for Variables when used in passing data from one Routine to another.

Let us say we have 2 routines (RtnA and RtnB), and we want to pass 3 parameters (Parm1, Parm2, Parm3) from RtnA to RtnB.

RtnA would look like

Last comment 1 September 2016
0 2
176

views

0

rating

NewBie's Corner Session 17 New command

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

New command

The New command limits a variable's scope or range of use. In theory the New command is simple, in reality the New command is powerful and needs to be respected and understood.  In Caché ObjectScript and MUMPS an entire chapter is devoted to it.

There are three variations of the New command:

When used without variables

When used with variable(s)

When used with variables in parenthesis

New command used without variables

Last comment 20 August 2016
0 5
369

views

0

rating