0 Followers · 1.1K Posts

SQL is a standard language for storing, manipulating and retrieving data in relational databases.

Question Tom Philippi · Dec 13, 2017

Recently viewed a demo on the new Dynamic Objects in InterSystems (we are still running 2016.1); together with the upcoming IRIS data platform I started thinking about possibilities of building dynamic databases. That is, I can imagine some projects were it might be really nice to store dynamic objects and then run sql queries on them without ever defining the fields of the dynamic objects (i.e. not at storage, but only if you run your sql query). If there is any system where this might be possible it is InterSystems Cache.  Of course, Ithis might not be a good idea for an entirety of reasons,

3
0 825
Article Timothy Leavitt · Oct 12, 2022 1m read

I just wrote up a quick sample to help a colleague load data into IRIS from R using RJDBC, and figured it's worth sharing here for future reference.

Ultimately it was pretty simple, aside from IRIS not liking "." in column names; the workaround is to just rename the columns. Someone better at R than me could probably provide some generic approach. smiley

2
1 305
Article Vicky Li · Nov 14, 2016 14m read

As we all know, Caché is a great database that accomplishes lots of tasks within itself. However, what do you do when you need to access an external database? One way is to use the Caché SQL Gateway via JDBC. In this article, my goal is to answer the following questions to help you familiarize yourself with the technology and debug some common problems.

Outline

2
8 4663
Question Guillaume Rongier · Sep 23, 2022

Hello,

I'm looking for a way to write a stored procedure or something to return a ResultSet with Embedded Python.

My goal is the following:

I have a Goal table with a Text field that is free text.

CREATETable Goal (
    Idint,
    TextVARCHAR(5000)
);


I would like to create a procedure that returns all the entities (in the iKnow sense) in a new Entity column.

Python code, i would like to use :

5
0 350
Question Chris Bebek · Sep 20, 2022

Trying to identify which records in the %SYS.Audit table are fails.

Eg, as user "WORKER", I run an attempted a grant, the terminal returns:

SQL> GRANT SELECT ON newschema.patients TO COORDINATOR
[S1000][Iris ODBC][State : S1000][Native Code 112]
[libirisodbc35.so]
[SQLCODE: <-112>:<Access violation>]
[Location: <ServerLoop>]
[%msg: <User WORKER does not have required privileges to grant the privilege(s)>]
[ISQL]ERROR: Could not SQLExecute
 

but the record in the audit table gives

Description: "SQL GRANT Statement"

EventData: "GRANT SELECT ON newschema.patients TO COORDINATOR"

2
0 231
Article Dmitry Maslennikov · Sep 15, 2022 4m read

On the Latest GlobalSummit 2022, InterSystems Introduced Cloud SQL. So, you may have lightweight InterSystems IRIS with access to SQL only. Well, what if you would still need some Interoperability features in the cloud as well? There are various solutions on the market nowadays, which offer a bunch of integration adapters out of the box and can be extended with support from the community. Some time ago, I've implemented an adapter for the Node-RED project, which can be deployed manually everywhere you want. Now I would like to introduce a new integration with my recent discovery, n8n.io

3
0 609
Question Manu Jose · Sep 6, 2022

How can we insert into a table using a stored procedure

Table structure :

CREATE TABLE SampleHospital (
    Hospital VARCHAR(50),
    Location VARCHAR(50),
    UserName VARCHAR(50),
       UserFullName VARCHAR(70),
       LastLogin TIMESTAMP,
       LoginCount int)

Procedure Name:

call Custom_MENS_Other.samplesp('2021-11-02','2021-11-04','H001')

2
0 266
Question Adrian Izadpanah · Aug 22, 2022

Hi, 

I am trying to input an entire xml into a sql server table. I am doing this via an operation in Ensemble.

I keep getting the following error

[SQL Server]XML parsing: line 0, character 0, unrecognized input signature

I have setup the table with a column parameter XML.

Here is the request object that is being sent to the store procedure

<reqSQL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">

<SQLScript>

{ call dbo.PopulateDataTable(?,?,?,?,?,?,?)}

</SQLScript><lstInputParams><lstInputParamsItem>

test

</lstInputParamsItem><lstInputParamsItem>

666666

0
0 477
Article Yuri Marx · Aug 8, 2022 24m read

In this article you will have access to the curated base of articles from the InterSystems Developer Community of the most relevant topics to learning InterSystems IRIS. Find top published articles ranked by Machine Learning, Embedded Python, JSON, API and REST Applications, Manage and Configure InterSystems Environments, Docker and Cloud, VSCode, SQL, Analytics/BI, Globals, Security, DevOps, Interoperability, Native API. Learn and Enjoy!

Machine Learning

6
7 1021
Question Michael Lundberg · Aug 15, 2022

Hi!

I have a question regarding SQL insert/update from the mananger portal's SQL window.

I am trying to do an insert with a value that contains multiple spaces ($32) between two words. This is needed for a comparative reason. But the spaces are automatically trimmed away all the time. How should I write to keep these?

Example:

Insert into TableA
(MyColumn) Values('xxxx    yyyy')

then the spaces are trimmed away and it becomes: 'xxxx yyyy'

But I want to keep the spaces. How do I get around the problem?

Regards,
Michael

4
0 260
Question Arthur K · Jun 5, 2022

Hi ,

     When I use jdbc driver to query the column info ,the "REMARKS" field always show the same as the "COLUMN_NAME" field.

When I use the sql "select * from INFORMATION_SCHEMA.columns a where a.table_name='some table name ' " to query columns info,there has a "DESCRIPTION" field ,the value is some comment for the current field.

So is there anyway to return the description to the jdbc  remarks field? And is there anyway to update the desciption or remarks field? Or is there some other way that I don't know to manage column comment info?

1
0 430
Question Glenn Bickel · Aug 11, 2022

Hi,

I encountered a strange issue I just can’t solve and I am running out of ideas. After reading the relevant passages of the documentation, asking the community is my last resort.

The task itself is not complicated at all. I am using an EnsLib.SQL.OutboundAdapter to connect to a MS SQL Server (12.0.6433.1) and execute a simple query. Said query is using a temporary table from which I just can’t select any data afterwards. All I get is this error message: <Ens>ErrNoSQLColumns.

I reduced the statement for debugging to this query:

DECLARE @result AS TABLE(

                CaseID varchar(50),

3
0 337
Question Nicola Sartore · Nov 5, 2021

I running a query and get the results inside a result set. Now I have to iterate through the result set many times. From the doc I've seen only the Next() method. Is there a way to reset the cursor? Otherwise what is a good data structure to save multiple rows of a table?

My code in this case is something like this:

   set sql = "SELECT * FROM MY_TABLE WHERE X= '"_Y_"'"
   set status = ..Adapter.ExecuteQuery(.rs, sql)
    // somehow iterate the rs more than one time

6
1 1709
Question Dom GMMH NHS Trust · Mar 17, 2022

Hi, we are trying to run a dynamically generated Oracle Insert SQL script using Do $SYSTEM.SQL.DDLImport("Oracle",""," sql.txt",[Error Log]) to insert multiple rows into a Linked Table within HealthConnect to an Oracle database.


We have tried using statements that are accepted within Oracle but not when using Intersystems DLL along the lines of :

4
0 694
Article Timothy Leavitt · Jun 28, 2022 2m read

An interesting pattern around unique indices came up recently (in internal discussion re: isc.rest) and I'd like to highlight it for the community.

As a motivating use case: suppose you have a class representing a tree, where each node also has a name, and we want nodes to be unique by name and parent node. We want each root node to have a unique name too. A natural implementation would be:

8
0 1138
Question Timothy Leavitt · Jul 20, 2022

I'm getting wrapped around the axle with CAST and CONVERT and can't seem to find a way to do this (short of adding a stored procedure wrapping $zdt($zdth(posix,-2),3), which I'm refusing to do on principle, because there has to be some way to make this work).

Any ideas?

4
0 296
Question Thembelani Mlalazi · Jul 19, 2022

I am calling a stored procedure over an ODBC connection and every time I call it there are several warnings written to the log event {Found no Parameter 1 (used as 1) for query}.I seem to be getting this on every query executed and that seems to happen a number of times the query parameters are per query and its filling up my disc.

1) Is there a way to suppress these warnings as the query seems to be executed and data written to the database?

1
0 285
Article Pravin Barton · May 12, 2022 1m read

Say I have a persistent class in IRIS with an optional property EmailOptIn:

Class Person Extends %Persistent
{
Property Name As %String;
Property EmailOptIn As %Boolean;
}

I later realize that I'm doing a lot of null-checking on this property where I shouldn't need to. The solution is to make this a required property:

Class Person Extends %Persistent
{
Property Name As %String;
Property EmailOptIn As %Boolean [ Required ];
}
7
0 514