Caché

Syndicate content 116 

Hi! We have received a request to create a new rule on CachéQuality to identify when a developer uses double quotes (" ") within any SQL statement.

We have been asked many times about SQL validation rules, and we would like to open a debate to allow everyone discuss what would you like to be checked on a SQL statement.

Current examples are for basic situations:

  • Using SQL.Statement class:

Set stmt = ##CLASS(%SQL.Statement).%New()
Set query = "Select Val1, Val2 FROM Table WHERE Val1=""SomeCondition"""

  • Using embedded SQL

&SQL(SELECT Val1, Val2
                INTO :val1, :val2
                FROM Table
                WHERE Val1="SomeCondition")

Last answer 1 April 2019 Last comment 28 March 2019
0   0 3
146

views

0

rating

How Tax Service, OpenStreetMap, and InterSystems IRIS
could help developers get clean addresses

 

Pieter Brueghel the Younger, Paying the Tax (The Tax Collector), 1640

 

In my previous article, we just skimmed the surface of objects. Let's continue our reconnaissance. Today's topic is a tough one. It's not quite BIG DATA, but it's still the data not easy to work with: we're talking about fairly large amounts of data. It won't all fit into RAM at once, and some of it won't even fit on the drive (not due to lack of space, but because there's a lot of junk). The name of our subject is FIAS DB: the Federal Information Address System database - the databases of addresses in Russia. The archive is 5.5 GB. And it's a compressed XML file. After extraction, it will be a full 53 GB (set aside 110 GB for extraction). And when you start to parse and convert it, that 110 GB won't be enough. There won't be enough RAM either.

+ 2   2 1
0

comments

108

views

+ 2

rating

Hello

I made for fun a bash script that creates csv files from a %GOGEN exported file.
%GOGEN, the utility for exporting globals for Cache 5.xx

First I thought it would be very simply with bash, but ...
- if I want a header in the csv file
- if you export with GOGEN more globals together not only one
- if I want a csv file for every global/indexes has the global ..

The simply bash script goes up 100 lines of code. If I will start again with this, I would use Python or Go, not bash.

Example:

For a EXPORTED.GLO fil

0   0 1
0

comments

38

views

0

rating

Hello,

 

Last weekend we've updated our Caché version to 

Versie:Cache for Windows (x86-64) 2018.1.1 (Build 312U) 

 

I'm using Studio to develop. I've been using the built-in debugger and it has been working nicely. But now, since the upgrade, I'm getting this error when trying to debug any routine or class method:

Executing ##class(Blue.App.Handler.Adsolut).TestConnection()
<COMMAND>zDebugStub+30^%Debugger.System.1

 

This is the code for the classmethod I got the error on

Last answer 14 March 2019 Last comment 30 March 2019
0   0 6
302

views

0

rating

InterSystems is delighted to announce the support of Docker container technology as a platform from the moment 2016.1 will be released.


Docker is a disruptive system technology that has many benefits and offers many advantages for those investing in infrastructure-as-code or immutable-infrastructure provisioning & deployment scenarios.
Like any new technology that appears, there is a learning curve, and many considerations need to occur when using it. However, Docker container technology has already proven to be successful by a huge follow-up with many companies already using it in production. Furthermore & FYI, all public cloud providers already support it.


InterSystems validates and supports its technologies on Docker container engine from v1.8 and above with CentOS, Ubuntu, RedHat and SUSE based containers from the official Docker Hub repository or their respective projects and sites.

Have fun with it

Last comment 29 March 2019
+ 5   0 9
1815

views

+ 5

rating

I want to upload several files using the html tag

< input multiple="multiple" name="BulkFileUpload" type="file">

. The upload.csp page in the SAMPLE namespace only shows how to extract a single file from the MimeData on the %request object. I cannot fathom how to extract multiple files from the MimeData in the %request object in cache. Can some kind soul explain to me how to do that?

Last answer 29 March 2019 Last comment 29 March 2019
0   0 2
43

views

0

rating

Hope someone can help me,  so i was developing a script and during the tests I was using the csession to execute a method. Also i thought i had to stop the instance i was using, so I used the ccontrol stop [instanceName] to stop the instance, but when i restarted the instance i got this error trying to start my production, I have an idea of what's the problem but i don't know how to fix it.

ERRO <Ens>ErrException: <FILEFULL>zStartProduction+62^Ens.Director.1 ^Ens.Runtime("Name"),/hs-connect-hom/db/BPINTEGRADEV-GLB/ -- - registrado no log como '-' número - @' Set ^Ens.Runtime("Name")=pProductionName'
Last answer 29 March 2019 Last comment 29 March 2019
0   0 3
50

views

0

rating

ObjectScript has at least three ways of handling errors (status codes, exceptions, SQLCODE, etc.). Most of the system code uses statuses but exceptions are easier to handle for a number of reasons. Working with legacy code you spend some time translating between the different techniques. I use these snippets a lot for reference. Hopefully they're useful to others as well.

Last comment 29 March 2019
+ 11   7 3
136

views

+ 11

rating

First time post, also a new Cache developer, hence the <Beginner> tag.

If our data has Predefined terms in a dictionary, and a user can add terms on their own, can the terms exist in different tables?

Lets call the tables "Terms" and the user data in "UserTerms".

If a third class definition has a property of "Term" can it not be either Terms or UserTerms?

I'm leaning towards using a Subclass strategy where the pseudo "Parent" (forgive me) is  Dictionary.Term and the child is along the lines of Dictionary.Term.User

Dictionary.Term.User can inherit from Dictionary.Term and this is stated in the Docs "If class B inherits from class A, you can use an instance of class B in any location where you can use an instance of class A."

This applies to properties of a class correct? Not just methods

Last answer 26 March 2019 Last comment 28 March 2019
0   0 3
66

views

0

rating

InterSystems Caché globals provide very convenient features for developers. But why are globals so fast and efficient?

Theory

Basically, the Caché database is a catalog having the same name as the database and containing the CACHE.DAT file. On Unix systems, the database can also be an ordinary disk partition

Last comment 27 March 2019
+ 8   3 9
2372

views

+ 8

rating

Hi, 

We recently moved our cache instance from windows 2012 to windows 2016 and when i try to now import % routines  i'm getting the following error  "Unable to obtain a write lock on this routine because either another user has the routine open for editing or you do not have write access to the database the routine is stored in. This item will be skipped."

 

This is a fresh installation of cache and I've moved the cache.dat and csp pages across. It seems to work fine but can't import % routines which I need. 

Has anyone experienced this and can help? 

Thanks

Last answer 26 March 2019 Last comment 27 March 2019
0   0 2
39

views

0

rating

Let's say we have a class 

AbcRequest extends Ens.Request, PropertiesBaseAbstractClass(has all my properties common to all request)

Prop1

Prop2 and so on

 

Now in my Business Operation 

I want to make a json dynamically from this request.

Yes obviously I can do is

 

Set requestDefinition = ##class(%Library.CompiledClass).%OpenId("MyCreateRequest")
Set JsonObject    = ##class(%DynamicObject).%New()        

        for i=1:1:requestDefinition.Properties.Count() {  
            Set key            = requestDefinition.Properties.GetAt(i).Name
            Set value        = $property(pRequest,requestDefinition.Properties.GetAt(i).Name)
            Set JsonObject.key = value
          
        }
        Set requestString        = JsonObject.%ToJSON()

This makes a json {"key":""}

 

 

 

 

Last answer 26 March 2019 Last comment 26 March 2019
0   0 3
47

views

0

rating

Good morning

I'm probably overlooking something very basic, but I'm running on Win2016 with Cache  2016.2 - All the work I am doing is in INT routines, but I'm making some calls to the Host File system using $ZF(-1).

I have a few mapped Network drives that are mapped in Windows, typically these are locations where I want to back up some files.

My process is quite simple:

1. Read data

2. Zip data files using RAR

3. Create folder on Network drive

4. Move RAR files to new network share.

I've tried a few different commands:

S LOC="G:\RAN\Backup1\",CMD="MD "_LOC,X=$ZF(-1,CMD)

S LOC="\\data1\data\RAN\Backup1\",CMD="MD "_LOC,X=$ZF(-1,CMD)

I'm unsure if its a limitation of Cache to do this sort of thing, or if I should created a BAT file and then kick off a Windows call to run the BAT file

Last answer 26 March 2019 Last comment 26 March 2019
+ 1   1 4
69

views

+ 1

rating

Hi Community

I have created a simple package that allows the use of Cache with the Laravel Framework.

From my initial testing everything seems to be operating smoothly but I would like to appeal to the PHP users in the community to help me improve this package.

For those of you out there who have time and would be interested in this, please visit the repo at https://github.com/jeandormehl/laracache

Thanks in advance

Last comment 25 March 2019
+ 4   2 3
178

views

+ 4

rating

I have an application using examples from the lottery example in samples name space how do I create a dynamically link based on the data displayed to add a record id to the link

the idea is to loop over the records displays fields and link to edit the shown data at the end of the record in a table format

Last answer 25 March 2019
0   0 2
0

comments

46

views

0

rating

Intro

Most server-client communication on the web is based on a request and response structure. The client sends a request to the server and the server responds to this request. The WebSocket protocol provides a two-way channel of communication between a server and client, allowing servers to send messages to clients without first receiving a request. For more information on the WebSocket protocol and its implementation in InterSystems IRIS, see the links below.

This tutorial is an update of "Asynchronous Websockets -- a quick tutorial" for Caché 2016.2+ and InterSystems IRIS 2018.1+

Last comment 22 March 2019
+ 4   2 3
262

views

+ 4

rating

I've seen a few password change posts, but I wasn't 100% sure it was the same process, so I am asking here. We periodically have to change the passwords for a few Cache user accounts across several servers. Is there a process/script to change these passwords without having to go into the web portal on each server?  Thanks so much, and I apologize if this was covered in some of the other articles that I've run across. Just looking for the best method.

Last answer 20 March 2019 Last comment 21 March 2019
0   0 2
66

views

0

rating

I am trying to convert a string to date but can not get it to work I have  function that I would like to take in a date string and covert it to date object

here is the ezample so far can not get it to work any help appreciated 

 

set p="12/03/2019"
 
w $System.SQL.TODATE(p,"YYYY-MM-DD")
 
<ILLEGAL VALUE>todate+32^%qarfunc

if I try this still get the wrong value returned

set p="12/03/2019" 
w $ZDATE(p,3)
1841-01-12

 

Last answer 21 March 2019 Last comment 12 March 2019
0   0 6
206

views

0

rating

I worked through the Community for proposals to provide end users
in an easy way with data formatted as EXCEL sheet.

There is an great article Tips & Tricks - SQL to Excel

there's an important message embedded: "EXCEL can interpret HTML tables and display them as usual"

Nice!
But the result is on your server and you are left alone to get it out to your remote user somewhere.
Could be a subject to be solved using REST or WebServices

Last comment 20 March 2019
+ 13   0 10
646

views

+ 13

rating

Hello all,

I am having some issues creating a docker image with a fresh cache installation. The error that I am getting right now is that gzip is required for a cache installation, but was not found in my system. Even though, this is shown as installed in the base centos 7 image. My host machine is Windows 10 using the latest docker version.

Here is my dockerfile, its simple:

FROM centos:latest

RUN yum update -y && yum -y upgrade

COPY ./cache-2017.1.3.317.0.18571-lnxrhx64.tar.gz .

RUN tar -zxf cache-2017.1.3.317.0.18571-lnxrhx64.tar.gz

RUN ISC_PACKAGE_INSTANCENAME="MyDatabase" \

          ISC_PACKAGE_INSTALLDIR="/usr/cachesys/" \

          ISC_PACKAGE_UNICODE="Y" \

         ISC_PACKAGE_CLIENT_COMPONENTS="" \

         ISC_PACKAGE_INITIAL_SECURITY="Minimal" \

        /cache-2017.1.3.317.0.18571-lnxrhx64/cinstall_silent



EXPOSE 57772 22 1972

ENTRYPOINT ["ccontrol", "start cache"]

Last answer 20 March 2019 Last comment 20 March 2019
0   0 3
104

views

0

rating

This question is about calling AWS REST APIs. Based on:

http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html

AWS requires REST clients to call their APIs using Signature Version 4 which in case you don't know what I am talking about is a pain in the neck.  Here comes the question:

Has anybody, by any chance implemented the v4 signing alg. in COS? If yes, would she or he have the kind heart to share?

Thanks,

Chris

 

 

Last answer 23 March 2017 Last comment 19 March 2019
0   0 4
273

views

0

rating