Article
· Mar 28, 2019 2m read
ObjectScript error handling snippets

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.

22 5
19 3.1K

I am generating the DDL from a modeling tool - ERStudio. But the DDL has 2 issues right now.

DROP TABLE schema_name. CASCADE CONSTRAINTS;
The Constraints is not supported but works with the statement - DROP TABLE Study_Definition.EVENT_STORE CASCADE;

Second if there is no object to drop, it throws an error, so is there a check like in sql server If_Exists that we can use in CacheDB?

0 1
0 211

I am writing an API that sends over a very large JSON object.

The code I'm using to get the data is actually used in our production system today for the use of writing a report.

However when I call the code using the API (using SoapUI) I am getting 'Error getting response; java.net.SocketTimeoutException: Read timed out'

The web applications settings have a session timeout setting at 15 minutes, but this is timing out within just a few minutes, so I know it's not hitting this mark.

0 3
0 289

Hello,

I have a couple of IOT devices that communicate via WebSockets to our backend.

I successfully managed to create a websocket connection between server and (iot)client using %CSP.WebSocket
However I would like to implement authentication on this using the HTTP headers at the same time of Connection: Upgrade.

I tried to set the headers to globals in order to debug but they are always empty.

Example code:

0 1
0 253

BridgeWorks is pleased to announce a VDM, v9.1.0.1. This release includes the following updates:

Updates

  • Historical Linking is now based off connection profile name
  • Saved Formatting is now based off connection profile name
  • Tables and Fields column headers no longer hide based on connection type

Bug Fixes

1 0
1 203
Question
· Dec 2, 2019
Operation System Permission

Hi all...

I am try to execute a class method from JDBC connection. My method are simple, just create a file at $HOME like this:

set sc='$zf(-1,"touch $HOME/lixo.txt > /var/tmp/log666 2>&1")

I put a log file to this commnad because it's don't work, and in log file i get this:

touch: cannot touch ‘/root/lixo.txt’: Permission denied


after to try other commands I found that user and enviromnent variables are diferents:
I try this:

0 8
0 264
Question
· Nov 18, 2019
Cache vs IRIS install

Has the Cache install been replaced with IRIS? Sorry if this is a silly question. I remember downloading Cache before and using Cache studio. I can't seem to find a download for that anymore, just IRIS? I did grab that and I'm able to connect Studio to what I need.

If there is still a Cache download, where can I find it?

Thanks!

0 4
0 784

Hello Community,

I would like to work in SQL developer with the tables from Caché.

Is it possible with JDBC tool?

What is the whole process in order to work in SQL developer? I have the access information to Caché, but i can only choose in SQL Developer software only Oracle or MySQL database type, therefore i think, that have to install any other tool.

Thank you in advance for your help!

br,

bálint

0 2
0 692
Question
· Nov 28, 2019
StreamContainer.

Hello,

I make some changes in our ObjectScript code between our prod environment and dev environment in the process 'Hl7AdtFileIsoslBp'.

The operation is a class with "EnsLib.TCP.TextLineOutboundAdapter".

In prod:

0 10
0 457

Hello community,

I recently added a change to our copy of zenutils.js, and while moving it up to production, I found different versions of zenutils.js. I edited a copy stored in the default directory for our web application (e.g. c:\intersystems\DEV\CSP\{application}) but the file on production is stored in {install dir}\CSP\broker.

0 1
0 309

HI,

I have made a query with class definitions and all their properties and put them in a view.

All is good besides Parameters is showing junk characters. Is there a way to do it cleanly besides getting into the code??

SELECT
CC.ID As CompiledClass,
CC.SqlSchemaName,
CC.SqlTableName,
CP.Name As PropertyName,
CP.SqlFieldName,
CP.Type,
PD.Parameters

FROM %Dictionary.CompiledProperty CP
JOIN %Dictionary.CompiledClass CC
ON CP.Parent = CC.ID

0 11
0 339

I have SQLCompute with SQLComputeCode on a couple of Properties in my class.

These work fin when I insert/update via ObjectScript or SQL from the ManagementPortal.

However, if I insert (create new record) via my C# app using the Caché ODBC DLL the SQLCompute is ignored, it does not run.

Is this expected InterSystems Caché behaviour? We are on latest IRIS platform.

0 7
0 389

Currently, many of you has some knowledge about CachéQuality (which is being renamed to objectscriptQuality) for analyzing objectscript code using the rules we have predefined. Probably you have tested it and have found too many warnings in your projects. I'm sure there are issues which are really important for you and some others which you would like to dismiss.

1 0
0 237

Hello everyone,

I am searching, but i cannot find a way to call a Procedure in Caché with PHP. Using .NET we have the Intersystems.Data.CacheClient.CacheCommand and we make a call in a Procedure. How i can do the same in PHP?

Regards,
Flávio

0 5
0 466

In time for InterSystems Global Summit 2019 we at George James Software are pleased to offer a cloud-hosted evaluation environment where you can work with Serenji in Visual Studio Code, editing and debugging ObjectScript in a sandbox running InterSystems IRIS 2019.3 Community edition.

You can do it all from your web browser. Nothing will be installed on your workstation, nor will any settings have to be changed on it.

To take Serenji for a test drive please visit https://georgejames.com/dc-gitpod

2 2
1 311

Some time ago I developed an application that tackled a familarial problem faced by many developers when required to update multiple UAT or PRODUCTION sites with the latest Software patches that have been developed and tested on your DEV server and now need to be deployed to multiple sites running that software.

In principle the solution works as follows:

1) Prepare an XML export of affected classes/routines/csp pages/hl7 definitions et al

2) Optionally create a global export of any new globals or changes to existing globals

1 1
0 326

Hello community,

I have a very simple REST API connection doing a POST of JSON messages via AZURE APIM.

It worked successfully for few weeks until a day ago when i started receiving a bad response as below.

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><script type="text/javascript" src="/_Incapsula_Resource?......................................

0 2
0 378

InterSystems Data Platforms products allow you to export and import security settings in two different ways.

This article talks about those options:
- On the command line, using ^SECURITY
- Programmatically, using the Export and Import methods of classes in the Security package

Exporting settings on the command line (^SECURITY)

You can export everything or individual sections of the security settings.

4 4
0 1.9K

We have a SOAP web service that we call to retrieve a stream of a PDF file. The web service is written by another group in our company (not a Cache group). We are running into one issue where it seems that the PDF is too big and when it is sent to us we get this "ERROR #6301: SAX XML Parser Error: <STORE>". The stream is about 8mb. This is the first time that we have encountered this issue.

We have a WRC ticket open about this but doing some research, we found that if we increase the $ZSTORAGE then we no longer get this error when we call the web service for this 8mb file.

0 4
0 1.6K