I tried executing the SQL JSON_TABLE query with large JSON string(more than 200000 characters) and I got the below error. I'm curious about this under the hood workflow and how does it reach reaches MAXSTRING.
Thanks!
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
I tried executing the SQL JSON_TABLE query with large JSON string(more than 200000 characters) and I got the below error. I'm curious about this under the hood workflow and how does it reach reaches MAXSTRING.
Thanks!
Hello, community.
I have a problem with running a SQL query on a linked MySQL table.
The connection works fine, but the following query throws an error:
SELECT TOP 10 * FROM linkedinternal_test.persons
[SQLCODE: <-400>:<Fatal error occurred>]
[%msg: <Remote JDBC error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10 T1.PersonID AS C1,T1.LastName AS C2,T1.FirstName AS C3,T1.Address AS C4,T1.Ci' at line 1. >]
Linked table class:
Imagine the scene. You are working happily at Widgets Direct, the internet's premier retailer of Widgets and Widget Accessories. Your boss has some devastating news, some customers might not be fully happy with their widgets, and we need a helpdesk application to track these complaints. To makes things interesting, he wants this with a very small code footprint and challenges you to deliver an application in less than 150 lines of code using InterSystems IRIS. Is this even possible?
Earlier this year I announced availability of a VS Code extension for coding in ObjectScript, Embedded Python or SQL using the notebook paradigm popularized by Jupyter. Today I published a maintenance release to correct a "getting started" problem.
Here's a video of the installation steps from the extension's README:
(video superseded by an update in a later comment)
Why not try it for yourself?
You'll find the original text and all my Advent of Code efforts in different programming languages in https://bitbucket.org/janihur/advent-of-code/src/master/
ObjectScript code discussed here is found in https://bitbucket.org/janihur/advent-of-code/src/master/objectscript
I have been using ObjectScript only on last 1,5 years maybe 30% of my working time but the code at work is very different than in these puzzles. You can find my random code snippets and learning notes from https://github.com/janihur/objectscript-ex
Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part3 Get some data (e.g. Artists)
Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client
OK we create a method to get data and lets try to get some Tracks 😁
Run the following line
w ##class(rest.utli.requestUtli).getdata("Spotify","/search","offset=5&limit=10&query=Shape%20of%20you&type=track&market=SG")ooooo no seems there is huge among of data returns.....😥
I would like to know what information can be found in 1 track....🤔 how about only query 1 track?
The InterSystems platforms have always offered dynamic documentation of the packages and classes in a namespace, a feature known informally as Documatic. But what if you need to publish this class reference information on a website without requiring the site to be connected to an IRIS server containing the actual classes?
Every time I try to update an SQL table using odbc connection, I'm getting: ERROR <Ens>ErrException: <MAX $ZF STRING>zPrepareW+1^%Library.SQLGatewayConnection.1
Set sqlStatement = "UPDATE dbo.Table1 SET OriginalMessageText="_OriginalMessageText_"WHERE Id='"_Id_"'"
$$$TRACE("SQL Statement: "_sqlStatement)
I know that the problem is with the length of the ORU HL7 message (that contains OBX base64 PDF file ) I'm trying to update in the table, but is there a way to fix this? other than truncating the message ?
I also tried this statement but it didn't work as well
I'm trying to project a series of objects and nested objects to XML, and I'm having difficulties getting the XML representation exactly the way I need it to be. Here's what I'm working with, nothing complicated:
Class XMLTest Extends (%RegisteredObject, %XML.Adaptor)
{
Property Id As Id;
}
Class Id Extends (%RegisteredObject, %XML.Adaptor)
{
Property Value As%String (XMLPROJECTION = "attribute");
}By default it seem closing tags are used with all elements, as such:
<XMLTest><IdValue="D1949EE1-7D03-4666-9548-D1A949E10327"></Id></XMLTest>Hence the question: is there a way to do that?
The goal is to get data (from half a thousand to 3-4 thousands lines) from DB, calculate standart deviation then use it as logical condition in analyzer.
For example IF std > custom_value = show_the_result ELSE null
There is a STDDEV(MDX) method used in Analyzer but it is a measure and it can not be used as logical condition (correct me if i am wrong)
As we keep updating our software, we often realize that we require more and more modern solutions. So far, only one major piece of our software relies on reading barcodes in documents and images. Since Cache did not have a means of reading barcodes in the past, we have always achieved our goals by using a Visual Basic 6 application. However, it is no longer an ideal solution because it is currently complicated to maintain it. IRIS also lacks this capability, but it has recently got an option that makes up for it: embedded Python!
Hello,
Is there a programmatic way (in ObjectScript) to determine if a string is an SQL reserved word (aside from using embedded SQL to try to name a property with that string and look for the error :-))?
Thank you,
Jean
I have a business process that adds data to a global variable on receipt of an HL7 message, and a scheduled task that executes a class method defined within the same business process that removes data from the same global variable. With this in mind it makes sense to consider concurrency and therefore make use of the LOCK command.
My first question is whether this is actually necessary?
Throughout the forum, I find examples of using the method getSegmentByIndex to get the segment as I loop through the HL7 message segments.
Today I spent way too long trying to figure out why I could not modify the segment with this same method. I reached out to my more experienced team and I showed where I got the base code from what I was doing, but I myself could not find the documentation of the method.
After some time, we stumbled upon the GetMutableSegmentAt and GetSegmentAt methods and plugged the mutable method in its place and what do you know, it worked!
As the title suggests, I would like to programmatically export each HL7 schema category as XML, either as a stream object or to a file. How would I go about doing this?
.png)
i am trying to embed a dynamic SQL into Objectscript code , but the %NEXT() will return 0 , however when i copy the same query and run it in the SQL bit it will give me the result i want
the code :
As the title suggests, I would like to programmatically export each individual data lookup table as XML, either as a stream object or to a file. How would I go about doing this?
Our TEST environment and PROD environment are on two different versions of HealthShare Health Connect.
| TEST | IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT [HealthConnect:7.2.0-1.r1] |
| PROD | IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1.4 (Build 812_0_22913U) Thu Dec 7 2023 17:06:30 EST [HealthConnect:3.5.0-1.m1] [HealthConnect:3.5.0-1.m1] |
Someone within the group wants to migrate a BP from TEST to PROD, however they are running into an error "attribute 'languageOverride' is not declared for element 'assign'"
User-defined aggregate functions have been supported in IRIS since 2021.1.0. I'd wished upon a star for these years ago before finding a secret hacky way to override MAX and MIN in a custom datatype, but didn't get a chance to actually try one out until today. I thought it was an interesting experience/example - the question of how to get a Median in IRIS SQL came up once before - so I'm sharing it here without too much further comment.
Hello,
I'm trying to carry a custom error from one business process to another.
BPL:LookupClass fails it's lookup and a custom error of "Lookup XYZ" is generated.
The class quits with that error, but upon quitting, the custom error gets wrapped in an Ensemble System error:
ERROR <Ens>ErrBPTerminated: Terminating BP LookupClass # due to error: Lookup XYZ
This means, when I use the %LastError property to get the error message, it's not got the value I want to use. In this case, "Lookup XYZ". It instead has "Terminating BP LookupClass # due to error: Lookup XYZ"
Many programming languages use the try-and-catch construct to handle runtime errors gracefully. If the code within the try block encounters an error, it will throw an exception to the catch block, where the error handling occurs. Today we will dive into the ObjectScript implementation of this construct and discuss some ways to clean things up.
ObjectScript Implementation Basics
To get started, we will first look at the basic structure of the try/catch block:
try{
//some code here
}
catch ex{
//some error handling here
}In ObjectScript you have a wide collection of functions that return some value
typically:
set variable = $somefunction(param1,param2, ...)
There is nothing special about that.
But there is a set of functions that I classify as LEFT SIDED
The specialty of them is that you can use them also on the left of the equal operator
as a target in the SET command:
set $somefunction(param1,param2, ...) = value
The reason to raise that subject is that with IRIS 2024.1 there is after may years a "new kid on this block"
Visual Studio Code releases new updates every month with new features and bug fixes, and the September 2024 release is now available.
Version 1.94 now includes:
Hi folks!
Often, when we develop commercial solutions, there is a necessity to deploy solutions without source code, e.g., in order to preserve the IP.
One of the ways how this can be achieved is to use InterSystems Package Manager.
Here I asked Midjourney to paint an intellectual property of software:
How this can be achieved with IPM?
In fact, this is very simple; just add the Deploy="true" clause in the Resource element in your module.xml manifest. Documentation.
Hi Community,
In this article, I will introduce my application iris-DataViz
iris-DataViz is an Exploratory Data Analysis and Visualization Streamlit Application that leverages the functionality of IRIS embedded python and SQLAlchemy to interact with IRIS, as well as the PyGWalker python library for data analysis and data Visualization. PyGWalker (Python Graphic Walker) is an interactive data visualization library built for Python, aiming to bring the ease and functionality of Tableau-style drag-and-drop visualization into Python environments.
This story has followed me for more than 20 years.
In the early days of ObjectScript, the volume of $Functions was limited.
You had to write it as part of your program.
But the functionality was often implemented. It just had no name.
To use it, you had "system" calls using $ZU() functions. See Reference
Hi,
I tried to create what is know as a "class variable". As far as I understand the only analogy to class variables would be the "class parameters".
I tried to use a class parameter but I cannot change its value at runtime.
Parameter STATUSES = {{}};
Property repr As %String;
Method %OnNew(repr) As %Status
{
w ##class(Test...).#STATUSES
w ..#STATUSES
...
}
When I get ..#STATUSES, it is a string like "5@%Library.DynamicObject". This is a string, not a pointer to an object.
I tried to define STATUSES as Parameter STATUSES As CONFIGVALUE = {{}}; and change the value with
Good morning, everyone
I purchased an HP LaserJet M101-M106 printer, and I'm trying to print via the Windows cache device, but I can't get it to work.
I can send it, but it doesn't print.
Physical device name: |PRN|HP LaserJet M101-M106
Type: Other
Subtype: P-DEC
Open Parameters: “W”
Could someone help me with what might be happening?
Otherwise, thanks
Davidson
Hi,
Do you know the best way to convert a %Library.ListOfDataTypes instance to a $LIST format string?
Thanks,
Blaise
The location of the currently executing code can be obtained using the $STACK function: $STACK($STACK,"PLACE").
Please refer to the following document for sample code.
How to get the location of the currently executing code [IRIS]
How to get the location of the currently executing code