Hello guys,
I need to tranform columns into rows or rows into columns.
I'm using only SQL Cache.
The code:
SELECTFROMWHEREThe columns:
.png)
Can you help me?
Thanks
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
Hello guys,
I need to tranform columns into rows or rows into columns.
I'm using only SQL Cache.
The code:
SELECTFROMWHEREThe columns:
.png)
Can you help me?
Thanks
Hi Everyone!
The Certification Team of InterSystems Learning Services is currently developing an InterSystems ObjectScript Specialist certification exam, and we are reaching out to our community for feedback that will help us evaluate and establish the contents of this exam.
Please note that this is one of two exams being developed to replace our InterSystems IRIS Core Solutions Developer exam. You can find more details about the other exam, InterSystems IRIS Developer Professional exam, here.
How do I provide my input? Complete our Job Task Analysis (JTA) survey
Hello everyone,
I’m facing issues with replicating data from my Caché 2016 database to a PostgreSQL database. I need to handle around 300 data updates per minute, and whenever certain tables are modified, those changes must be reflected in other databases.
So far, I’ve tried various approaches, including:
However, each of these solutions has led to performance bottlenecks and system lockups.
I need to use a context variable in my code block for the table to query. When I use :content.table, it does not work. When using the literal, it does. How do I get the :context to work?
.png)
Hi! I've extended my demo repository, andreas5588/demo-dbs-iris, to make it easy to test the FOREIGN SERVER and FOREIGN TABLE features in IRIS.
To achieve this, I created a namespace called FEDERATION. The idea is as follows:
The Script: demo-dbs-iris/src/sql/02_create_foreign_server.sql.png)
IRIS does not support executing SQL statements that combine tables from different namespaces.
In tracking down some of our Orphaned message issues, I was wondering if setting our EnsLib.SQL.Snapshot variable equal to "" was the same as calling the .Clean() method on EnsLib.SQL.Snapshot? Are they the same?
should I be possibly using ##class(EnsLib.SQL.Snapshot).%Delete() instead?
Hy Friends,
I have a little problem, I need to diplay the data based on input status (first time and after)
this is the data:
.png)
and this what I need to display
the notes become new because it is the first time that the data has been inputed, and it will become old if we have the data before (2nd data, 3rd data the notes will become old).
I've try to use SubQuery (with LAG Script also) but it doesn't works, because it will give a notes Old even it's a New Data
Does anyone could help me ?
Thank You
Best Regards,
Steven Henry
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:
/// Generated by the Link Table wizard on 2025-01-08 16:09:03. Note that you can access the data in this class only when the external database is accessible.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?
Hello everyone,
My team is currently developing guidance and best practices for the generation, storage, and deployment of TUNE TABLE statistics across development and production environments. With that in mind, we want to get an idea of what methods teams in the field have developed for handling this data. In particular, we’d like to know the following:
There are three things most important to any SQL performance conversation: Indices, TuneTable, and Show Plan. The attached PDFs includes historical presentations on these topics that cover the basics of these 3 things in one place. Our documentation provides more detail on these and other SQL Performance topics in the links below. The eLearning options reinforces several of these topics. In addition, there are several Developer Community articles which touch on SQL performance, and those relevant links are also listed.
There is a fair amount of repetition in the information listed below. The most important aspects of SQL performance to consider are:
How to read a Show Plan to better understand if a query is good or bad
Hello my Friends,
I have a question, I have a data like this
.png)
And I want to create a display like this, which I can put a status column beside the Item Column
The status become new, if there's no previous item, and if there's a same item after the first one, the status become Old
Does anyone could help me ?
I need to display it without subquery if possible
Thank You
Best Regards,
Steven Henry
Hi everyone,
I’m currently experimenting with the SQL Gateway Connection, CREATE FOREIGN SERVER, and the THROUGH command (IRIS Documentation). To speed up my tests, I’ve combined several DemoDataSets in a Docker container and would like to automate the creation of SQL Gateway Connections using code.
(By the way, if you’re interested, the Docker container is available here: Demo DBs IRIS.)
To achieve this, I’m using SQL to create a connection by running a command like
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?
I recently met an ages old issue related to code maintenance:
But you need to take a look on Classes or Routines or Globals !!
Anyhow SQL is your friend.
CREATEGLOBALTEMPORARYNot a thrilling action.
INHow to use it:
whereAnd you get:
"1"<?xml version=I am attempting to create a Foreign Server/Table so I can pull some information in from MS SQL server via JDBC connection, but as soon as I create the Server/Table and logout the Foreign Server disappears.
CREATE FOREIGN SERVER Epic.Clarity
FOREIGN DATA WRAPPER JDBC CONNECTION 'MS-EpicClarity'logout, then run
.png)
the documentation - Defining Foreign Tables | Using InterSystems SQL | InterSystems IRIS Data Platform 2024.3 mentions "A user that creates a foreign server must have the %MANAGE_FOREIGN_SERVER administrative privilege" but I am not finding that security setting to give to my role.
My IRIS instance is connected to a Postgres database using SQL Gateway and linked tables. One of these tables is projected to the Patient class. I want to select a record from this table by ID and convert it to a FHIR resource using the %ExistsId and %OpenId methods. I noticed that if I call these two methods from the console, the record is always found. But, if I do the same from the FHIR Facade layer, the %OpenId method returns NULL.
Like many others probably find themselves, we were stuck doing live data mapping in our Interface Engine that we really didn't want to do, but had no good alternative choice. We want to only keep mappings for as long as possibly needed and then purge expired rows based upon a TTL value. We actually had 4 use cases for it ourselves before we built this. Use cases:
Hi everyone,
I’m using EnsLib.SQL.OutboundAdapter in my InterSystems Ensemble operation to execute an insert statement in Sql Server Management Studio 20. While inline queries (e.g., constructing the query string with _ concatenation) work fine, I'm facing issues when trying to use parameterized queries.
Serialized JSON: {"CHI":"2894","Forename":"Janis"}
Include Ensemble
ClassExtendsAsFirst time trying to use Foreign Tables/Servers instead of Linked Tables...
Within the SQL Editor inside of the Managment Portal, or connecting through DBeaver JDBC how we can see what Foreign Servers have been defined? Is there a way to query and verify structure of the Foreign Server connection to know that we are building the correct Foreign Tables?
I attempted to create my first Foreign table but it failed when I tried to query the tables because it said the table could not be found. But when I sign into the Database via SQL Management Studio, I can see the table.
Hello My Friends,
I have a question how to use order by %DLIST, this is my code:
SELECT
$ListToString(%DLIST(DISTINCT MRDIA_ICDCode_DR->MRCID_Code),', ' ) ICDX,
$ListToString(%DLIST(DISTINCT (MRDIA_ICDCode_DR->MRCID_Desc || ' (' || MRDIA_DiagnosisType_DR->DTYP_Code || ')')),', ' ) Diagnose
FROM SQLUser.PA_Adm
LEFT JOIN SQLUser.PA_AdmInsurance ON (PAADM_RowID = INS_ParRef AND INS_Rank = 1)
LEFT JOIN SQLUser.PA_AdmPackage ON (PAADM_RowID = PACK_ParRef)
LEFT JOIN SQLUser.MR_Adm on MRADM_ADM_DR = PAADM_RowID
LEFT JOIN SQLUser.MR_Diagnos ON MRADM_RowId = MRDIA_MRADM_ParRef
LEFT JOIN SQLUser.
I have issue with one of my queries. That query work fine for ages, but suddenly stop works and giving me SQLCODE 100 in the routine.
&SQL(
SELECTFROM) AND kiosk = :%varIf I copy this same query to the management portal and replace variable with real ID I will get back 6 or more rows.
The rise of Big Data projects, real-time self-service analytics, online query services, and social networks, among others, have enabled scenarios for massive and high-performance data queries. In response to this challenge, MPP (massively parallel processing database) technology was created, and it quickly established itself. Among the open-source MPP options, Presto (https://prestodb.io/) is the best-known option. It originated in Facebook and was utilized for data analytics, but later became open-sourced. However, since Teradata has joined the Presto community, it offers support now.
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)
And there is a Embedded Python with numpy, but logic behind STDDEV(MDX) and numpy.
This demo has an interoperability production with 16 items.
The first part of this demonstration consists of sending an HL7 SIU file which will be transmitted to the 2 other HL7 flows (HTTP and TCP), and transformed and transmitted to the Kafka server. HTTP and TCP flows will transform HL7 messages in the same way before sending them to Kafka as well.
I am using a JDBC connection to MS SQL server to execute a stored procedure to select data and bring it into InterSystems as a EnsLib.SQL.Snapshot. I loop through the EnsLib.SQL.Snapshot using a while loop, but I also want to iterate through the Columns within that Row to do logic.
Is there a way to iterate through the Columns of the current Row of the EnsLib.SQL.Snapshot so I can apply logic/rules for further processing?
Thanks
Scott
Hello all,
We have our system with AutoParallel enabled:
USER>w ##class(%SYSTEM.SQL.Util).GetOption("AutoParallel")
1But whenever I try to run any sql the autoparallel does not work. For example, this simple query:
.png)
When I force it with %PARALLEL we can see it will effectively run in parallel:
The total records is bigger than the threshold. So, what can go wrong? Anyone in the same situation?
I'm playing with some anayltic queries against FHIR server tables. The HSFHIR_X0002_S_Patient.addressCity table contains a lot of cities which names contain german charachers such as ä, ö and ü.
The following query works fine:
select value from HSFHIR_X0002_S_Patient.addressCity
But this one converts city names to uppercase, and characters with umlauts are lost, so instead of "Köln" or "München" I see KOLN and MUNCHEN:
select ac.value, count(ac.value) as cnt
from HSFHIR_X0002_S_Patient.addressCity ac
group by ac.value
order by 2 desc
I'm using DBeaver with IRIS official JDBC driver.