Hi Community,
Please welcome the new video on InterSystems Developers YouTube:
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
Hi Community,
Please welcome the new video on InterSystems Developers YouTube:
I am trying to populate a table using the sql Data Import Wizard. The input file is a tab delimited text file. But the import keeps failing with a 104 error showing validation for the columns which use %Library.TimeStamp and %Boolean datatypes is failing. Yet when I insert values into the table through a SQL insert command, the values get saved correctly in the table.
For the TimeStamp format in the wizard form, I am choosing YYYY-MM-DD-HH:MI:SS because there was no option for this format: YYYY-MM-DD HH:MM:SS.
I'm using a JDBC driver to connect PGSQL -> Cache. I'm noticing when I run SELECT queries and COUNT(*) command against the same table, I get different result sets. I'm pretty new to Cache in general - so I'm trying to understand why these would be different.
Examples (TransID and InvNum should occur in every "row"):
SELECT COUNT(*) FROM ACCT.Services = 1,090,324 WHERE ACCT.Dept = 483
SELECT TransID FROM ACCT.Services = 1,085,776 WHERE ACCT.Dept = 483
SELECT InvNum FROM ACCT.Services = 586,023 WHERE ACCT.
Hey Developers,
Enjoy watching this new video on InterSystems Developers YouTube:
⏯ Demo of REST APIs defined in Swagger, built with InterSystems IRIS interfacing with a SQL backend
In this article we are going to show the results of the comparision between IRIS and Postgress when handling Astronomy data.
Since the earliest days of human civilization we have been fascinated by the sky at night. There are so many stars! Everybody has dreamed about them and fantasized about life in other planets.
Astronomers have been identifying and classifying stars since many centuries ago. There are star catalogues compiled in Mesopotamia and Egypt from the 2nd millennium BC [1]. In modern times there have been two main catalogues: Hipparcos [2] and Gaia [3].
Hi ,
I am trying to retrieve the contact type column data of a patient based on the recent date as shown below.
for instance
contacttype Datefrom
contact 1. 24/03/2020
contact 2. 20/05/2021
i need to retrieve the second contact2 based on the recent date.
i tried like below but not working .
Case max(datefrom) >0 then contacttype
End as contacttype
Can anyone please tell me why this is not working.Any other options?
Thanks
jude
I need to show the absence of data, so I have to join the list of predefined values with a result of a select statement.
However, it seems like Table Value Constructors in JOIN are either not supported, or I do not understand the syntax.
Basically, I am going for something like this:
Select v.valueId, m.name
From (values (1), (2), (3), (4), (5)) v(valueId)
left Join otherTable m
on m.id = v.valueIdIs it supported in Cache SQL or not?
Hello. I have a query in the database that returns several rows, I need to get an "X" number of results randomly. I tried traditional commands from other languages but was unsuccessful. Does Caché have something like that?
Hi,
I'm getting thousands of errors like the ones below:
2021-05-03 14:11:44 [SQLCODE: <-400>:<Ocorreu um erro fatal>] [Cache Error: <<READ>Dispatch+14^%SYS.BINDSRV>] [Location: <ServerLoop>] [Client info: <Username: KIORAS, Node Name: 3IK0VLS5UU, IP Address: 192.168.1.223, Executable Name: EXTRService.exe, Internal Function: B0>] [%protocol: <52>] $Id: //ce/2018.1.2/kernel/common/src/aclass.c#1 $ 23468 104
2021-05-03 14:35:39 [SQLCODE: <-400>:<Ocorreu um erro fatal>] [Cache Error: <<READ>ServerLoop+16^%SYS.
Hi all,
I'm wondering if is possible to get the values of itself to run a query.
I want to create some query to find a value into a %Persistent class but each one use diferent values.
Class Kurro.MyClass Extends %Persistent
{
/// Key of process
Property KeyProcess As %String(MAXLEN = "");
/// Specialist
Property CodeSpecialist As %String;
/// Provider
Property CodeProvider As %String;
/// Center
Property CodeCenter As %String;
/// Date
Property Date As %TimeStamp;
/// IdList
Property IdList As %String;
/// IdProcess
Property IdProcess As %String;
/// Duration
Property Duration As %String;
Query GetInfo(pObject AS Kurro.MyClass) As %SQLQuery(CONTAINID = 1, ROWSPEC = "IdList:%String,IdProcess:%String,Duration:%String")
{
SELECT IdList, IdProcess, Duration
FROM Kurro.MyClass
WHERE KeyProcess = :pObject.KeyProcess
AND CodeSpecialist = :pObject.CodeSpecialist
AND CodeProvider = :pObject.CodeProvider
AND CodeCenter = :pObject.CodeCenter
AND Date = :pObject.Date
}
}The boss (reasonable intelligent ;-) wants to connect to the cache database through Excel, but unless I explain what he's looking for (field names DB names etc) then I can see him continually coming back for "what's the link here and how do I get the delivery company name etc etc"
is there a SAFE way I can give him access to our database using an intelligent visual user interface.
I had thought about the SQL Query Builder within the management portal, but the thought of giving him access to all of the other functionality of the management portal.
Hello everyone!
Some time ago, I changed the configuration in SQL Runtime Statistic to "Turn on Stats code generation to gather stats at the Open and Close of a query". With this change, the CACHE base (cache/mgr/cache/) has grown a lot to reach 198GB.
Yesterday, I returned the configuration of SQL Runtime Statistic to the default which is "Turn off Stats code generation" and the cache base is no longer growing.
My question is?
How to delete this data that was created in the CACHE base (cache/mgr/cache/) and what data I can delete without affecting the system.
Thanks,
Fábio Louly.
Hi Community,
See how the new embedded Python feature enables you to write user-defined SQL functions and stored procedures in Python:
⏯ Embedding Python in SQL: Write Your Stored Procedures in Python
Is it possible execute create table from management portal?
I tried this:
CREATE TABLE SQLUser.Teste(ID INT NOT NULL, coluna1 VARCHAR(255), coluna2 VARCHAR(255), coluna3 VARCHAR(255), coluna4 VARCHAR(255)CONSTRAINT TestePK PRIMARY KEY (ID))
Error message:
.png)
Following instructions on this page https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=D2IMP… I am trying to create a Data Connector to be used as a base class for a cube with update support.
That page suggests that putting an SQL query inside XData block is not suitable for a Data Connector that supports updates.
Later it also suggests that to enable updates your SQL query must include
WHERE $$$RESTRICT
Providing an example of it in XData block example like this
<sql>SELECT A,B,C FROM MyApp.MyTable WHERE $$$RESTRICT</sql>
Hello everyone,
First, thanks in advance for your help :-)
I noticed that a query called directly in a method of a class of a business operation does not return the same result as if I apply the same query in the same Caché database from Squirrel !!!
I don't understand why ???
Here is the query :
SELECT Header.MessageBodyId, MsgBody.Name AS typMessage
FROM Ens.MessageHeader Header
INNER JOIN EnsLib_HL7.Message MsgBody on Header.MessageBodyId = MsgBody.ID AND MsgBody.TimeCreated >= '2021-04-12 00:00:00' AND MsgBody.
Hi, in the end I want a report like this:
| Schema | TableName | RowCount |
| SYSTEM | RADplus_event_log | 18,251,308 |
| DocM | log_image_transfer | 7,196,272 |
| SYSTEM | RADplus_audit_database_tables | 3,345,757 |
| … | ||
| SYSTEM | view_summary_mvmt | 0 |
In my case I have about 1,230 tables/views in the database. The initial approached I've used is to use this SQL to generate SQL to make the actual measures:
SELECT
string('select ''', table_schema ,''' as "Schema", ''', table_name,''' as TableName, COUNT(*) as RowCount from ' , table_schema,'.
October 17, 2019
Anton Umnikov
Sr. Cloud Solutions Architect at InterSystems
AWS CSAA, GCP CACE
AWS Glue is a fully managed ETL (extract, transform, and load) service that makes it simple and cost-effective to categorize your data, clean it, enrich it, and move it reliably between various data stores.
In the case of InterSystems IRIS, AWS Glue allows moving large amounts of data from both Cloud and on-Prem data sources into IRIS.
Hi,
is it possible to access a property defined as %List from sql? I´d like to search for a object containing a specific value in it´s %List defined property. Is there a predefined sql function for that within IRIS?
best regards,
Sebastian
Background: We have our own SQL map that predates InterSystems'. A program writes an XML file for each table map class as $system.OBJ.Export would. $system.OBJ.LoadDir loads the XML files into .cls files.
The reason is a long story, but we need to update parameter EXTENTSIZE (only) in existing classes. This does not seem to happen. As a test I used $system.OBJ.
Hi,
I'm doing a query in SQL and I need to sort my data by some non-repeated field.
Unfortunately, my data is grouped in a way that I cannot guarantee that any column will not have repeated data, so one solution would be to take the row number.
Also, the Cache is not accepting Row_Number () in my querry and I would like to know if there is another solution to return line numbers or some way to add this function to the Cache.
Best regards.
Cache ODBC State S1000 Native Code 400 Illegal Value
This is my query:
select DateTijdSec from
GLPPatTcActie
where pnr = '27085070017' and LTestId->Makey='BLA' and VerzamelDatTijd < '2021-03-04-2021 09:04' and glpactieid->makey in ('TAV','TMA') order by DateTijdSec desc
Most likely there is a wrong date time in the table, how can i get the data?
PORTUGUESE
Olá a todos!
Estou com dificuldades de fazer meu select para retornar palavras que contém acentos.
Na minha tabela TESTE, por exemplo, tenho palavras no campo NOME como Fábio e Fabio, porém se eu coloco a instrução:
SELECT * FROM TESTE
WHERE nome LIKE 'FÁBIO'
a instrução só traz FÁBIO.
Como eu faço para trazer todas as palavras: FÁBIO, FABIO, FABÍO, FABIÓ, FÁBÍÓ, FÂBIO, etc...
Conto com sua ajuda!
ENGLISH Hello everyone! I'm having trouble making my select to return words that contain accents. In my TEST table, for example, I have words in the NAME field like Fábio and Fabio, but if I put the instruction: SELECT * FROM TEST WHERE name LIKE 'FÁBIO' the instruction only brings FÁBIO. How do I bring all the words: FÁBIO, FABIO, FABÍO, FABIÓ, FÁBÍÓ, FÁBIO, etc ... I hope your help!
Hi,
Im wondering if its possible to pass a SQL query through to the Power BI IRIS Connector? I can't currently see an option - and have tried through advance editor to use M Query syntax to attempt this with no luck.
Has anyone else in the community had any luck or know if this is supported?
Thanks.
It is common to test a connection sending a general SQL instruction to the database, in Oracle we send select 1 from dual, for example, and in IRIS what the best option?
I am trying to use Dynamic SQL because I need to supply data at runtime.
The generated query returns 0 rows for some reason. If I copy/paste the query into Monitor, it works correctly. I am suspecting it has something to do with dates being the wrong format (I am supplying them in 'YYYY-MM-DD' format). Is that the cause? And if so, how do I supply dates in correct format?
Hi! I have a complex SQL select query which I execute via %ResultSet. It also includes a UNION. The select statement within the union should only be done when an external parameter is set, and I'm not sure of way of doing that within SQL, other than something like
SELECT FOO FROM BAR
WHERE (some conditions)
UNION
SELECT FOO2 FROM BAR2
WHERE :doUnion = 1 AND (some conditions)
this works, but I don't think it's particularly optimal as I believe it will still execute the second SELECT regardless of :doUnion.
I'm participating in the Developing with InterSystems Objects and SQL with Joel Solon. The course is very nice and I will share with you some tips I got during the training. Tips presented in the day 4:
Why when I use a SQL on the Cache, the condition between "the expression" and "the expression", not permite to me, delete the all ID of this data class?
Hi folks!
Sometimes when we develop a mockup or PoC there is a need for a simple interface that will provide data in IRIS in JSON against SQL queries.
And recently I contributed a simple module that does exactly that:
accepts SQL string and returns the JSON.
How to install? Just call:
zpm "install sql-rest"
If you install it in a namespace X it will setup a /sql endpoint to your system that will accept POST requests with SQL string and will return the result for you for the data available in the namespace X.