Question
· Apr 1, 2023
NOT %INLIST

Hi.

I have a query:

SELECT '['||Material->Sifra||'] '||Material->Opis AS Material,
SUM(MasaBlago) AS MasaBlago
FROM Tehtanje.Dokument
WHERE DatumDokumenta BETWEEN '01/01/2023' AND '04/01/2023'
AND (Material->Sifra %INLIST $LISTFROMSTRING('5,7',','))
GROUP BY Material
ORDER BY %EXACT Material

The query returns all rows where Material->Sifra is 5 or 7. That's OK.

If I want to get all rows where Material->Sifra is NOT 5 or 7 I use query:

0 2
0 247

In writing some code on:

Cache for Windows (x86-64) 2015.1 (Build 429U) Fri Feb 13 2015 14:37:23 EST

I noticed an unexpected "ROLLFAIL" error when a Unique Index fail was generated in a %Save() call.

The object SHOULD fail to save, since the Unique criteria is not met, but I didn't expect to see a ROLLFAIL error as the "Last Error".

When running the following class code:

0 4
0 941
Question
· Mar 22, 2017
Query

Hi All, In Cache Table i have stored the data value as horlog format ,by query how to retrive the data when i give the data field as date format.

0 4
0 487
Question
· Jun 14, 2017
SQL Query for Range

Hello,

I have a question related to running an SQL query for range of data.

I am running a query like:

Select A,B from table_name where A>=12345 AND A<=12390

- Where A and B are my two of the properties under the mentioned table/class definition

- A is an integer property

Question: The result of the above query does not return me all the values between the mentioned range of integer though I do have all the values in that range. I see that some of the values are missing in result.

0 9
0 450

Hello! So, my knowledge on the Cache database is extremely limited, and I was hoping I could find some assistance here. I'm connecting to the DB via ODBC. The table(s) I'm interested in are named as such nameYYYYMMDD. So each day, a new table is created with logs. We'd like to grab these records each day, for the previous day's logs.

0 2
0 645
Question
· Sep 22, 2017
browse sql record

Hi , World

this is i field in my global:

{"profile_id":"9XOzzcI8NfSUjxAhEt0cTLRejwmp6HPi","biometrics":[{"timestamp":"2017-05-17T13:45:40","utc_offset":"+02:00","resting_heartrate":120.0,"spo2":98.0,"activity_id":"591c540aac8f295479ee14ce"}]}

for information: it's respective key is "peyload"

my question is :

I want to extract the timestamps value , and the profile_id value , how can i do?

thank's

0 4
0 335
Question
· Nov 14, 2017
type data interval

Hi communauty

I've two columns in my table and the type must be interval of integer values for example : age must be interval between [2 and 6] years and wigth between [10 and 30 ] Kg , how can i define them when creating my table?

thank's

0 3
0 224

Any insights, news, alternatives or experience about sequence pattern querying like with Oracle's MATCH_RECOGNIZE, more declarative, less simple direct COS way? Both obvious solutions (shadowing data to oracle cloud or implementing MATCH_RECOGNIZE compiler in COS from scratch) seem big overkill. Do Intersystems have plans to adopt this "2007 ANSI standard proposal" and "SQL:2016 standard"

0 3
0 477

I have created a view to stage some data in a different format and then want to reference that view in a SQL query from a table that filters the data from the view using a property of the table.

Example:

select
MsgId,
FileName,
(select
ReportName
from
custom_view
where
MsgId = ReportId
) as ReportName
from
main_table

Is this even possible? When I try this, I get an error table not found for the view?

David

0 1
0 267

Hi Community!

New session recording from Global Summit 2018 is available on InterSystems Developers YouTube Channel:

An Outlook on Scaling Out

https://www.youtube.com/embed/lyACfOWDFFg
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

0 0
0 230

Is there a way or can it be done to use conditional logic in sql like so

 Query Q1(formal as %String) As %SQLQuery [ Final ]
{
    
    SELECT patientnumber,ID, CASE
    WHEN ID = 50 THEN "The is 50"
    WHEN ID = 30 THEN "This is 30"
    ELSE "The quantity is under 30"
END FROM Audit.Table WHERE ID = :formal AND EndDate is null} 

}

0 2
0 338

Say I have a property in a persistent class that stores list of colours and I would like to query that field and return a list and be able to loop that list to get individual colours how will l go about achieving this I have tried something like this but its not working as expected

 &sql(SELECT colour INTO :colourList FROM favouritecolours)
 While (SQLCODE = 0) 
{
 for i=1:1:$LENGTH($P(colourList,","))
 {
 set fvalue=$P(colourList,",",i) 
write "the first"_fvalue,i, 
} 
}
0 1
0 468

I configured a SQL inbound adapter to monitor my local Cache database.

But I got "ERROR <Ens>ErrOutConnectFailed: ODBC Connect failed for 'SAMPLES' /
'' with error ERROR #6022: Gateway failed: DSN/User Connect."

Same error if the DSN setting is blank or set to my namespace.

Question is whether SQL inbound adapter is for external database server ONLY?

0 3
0 270

Hi,

The question is about queries on the System->SQL page. I have a class with a few columns on a global and the test output looks as expected, below. This works as expected as well returning a single row: select * from Utils.RoutineAuditReport where counter=4. However, other columns give an odd error like " Field 'AG' not found in the applicable tables^ SELECT * FROM Utils . RoutineAuditReport WHERE UserR = "AG". As you can see below, both the UserR column and the AG entry in it do exist. What could be the problem?

Thanks in advance,
Anna

0 2
0 179

I need to execute multiple DELETE statements in a single query like this

DELETE FROM TableName WHERE ID = 2;
DELETE FROM TableName WHERE ID = 3;
DELETE FROM TableName WHERE ID = 4;

However It does not work when there're more than 2 statements and gives me an error

Expected FROM found WHERE^DELETE FROM TableName WHERE

Using IN is not an option.

0 9
0 334

I've been accessing Cache tables from a developer/reporting side, but am now involved in a project to create a data warehouse for our application. I'm trying to find a query I can use to return the sizes of all the tables in the database, so we can identify the largest tables and handle those individually. Can someone give me a query I can run against our Cache database to return the sizes of all the tables from largest to smallest?

Thanks for the help

0 8
0 650

Hey Developers,

See how you can get high-performance relational access using SQL to manage data within your InterSystems products:

Using SQL with InterSystems IRIS

https://www.youtube.com/embed/7l-YT5y-nJo
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

0 2
0 219

Hi All,

I am currently using D $SYSTEM.SQL.Shell() command or management portal to retrieve the data from database. I just learned we can also run cache table sql queries in MS access. MS access already installed on my machine.

I need to ask how I can connect my database of USER or sample namespace in MS access to run these SQL queries.

Thanks in advance!!

0 4
0 208

I need a stored procedure where I can execute multiple delete from statements.

This will work to create a stored procedure, but when I add in other delete from, get error invalid sql statements when try to create

CREATE PROCEDURE DeleteSpecimenTwo
(IN Specno VARCHAR(50))
BEGIN
DELETE FROM PCONT WHERE PSPECNO = :Specno;
END;

This doesn't work

CREATE PROCEDURE DeleteSpecimenTwo
(IN Specno VARCHAR(50))
BEGIN
DELETE FROM PCONT WHERE PSPECNO = :Specno;

DELETE FROM PSPEC WHERE PSPECNO = :Specno;
END;

0 1
0 206

Here're the technology bonuses for the InterSystems IRIS Cloud SQL and IntegratedML Contest 2023 that will give you extra points in the voting:

  • IntegratedML usage
  • Online Demo
  • Article on Developer Community
  • The second article on Developer Community
  • Video on YouTube
  • First Time Contribution
  • Community Idea Implementation
  • IRIS Cloud SQL Survey

See the details below.<--break->

0 2
0 350