We have 1lakh records in table and while using sql select statement , it is taking more than 9mins to 12 mins to get the records. could you please how to optimize this performance issue if we have more records. how to optimize it.
Hello,
I need help in health insight. I am trying to generate reports on deep see but i am not able to pull in the patient ids as these are our requirements for the project. Can anyone help me in unlocking this feature.
Can anyone help me with link to correct documentation on how to access the edge gateways of multiple facilities to access the clinical data on sql explorer.
When i use ##class(%SQL.Statement).%New() -> .%Execute() and then .%Next() to go through the result set, i could only go through part of the result. And then, i have to call
Class Queries in InterSystems IRIS (and Cache, Ensemble, HealthShare) is a useful tool that separates SQL queries from Object Script code. Basically, it works like this: suppose that you want to use the same SQL query with different arguments in several different places.In this case you can avoid code duplication by declaring the query body as a class query and then calling this query by name.
I got a resultset, and some columns might be a JSON_OBJECT. Is there a way (based on metadata) to determine that the column was formed from JSON_OBJECT function?
set rs = ##class(%SQL.Statement).%ExecDirect(,"SELECT 1 colA, JSON_OBJECT('id':1) col2")
do rs.%Display()
I'm close with this but I'm not sure how to grab JUST the GT1.3 data. I know I can do a substring but finding the 3rd | is a tad tricky. I've not been this deep in SQL for 15 years.
SELECT SUBSTRING(hm.RawContent, (CHARINDEX('GT1',hm.RawContent)), 50) as NameDesc FROM Ens.MessageHeader as em, EnsLib_HL7.Message as hm where em.Status = 'Suspended' and em.MessageBodyId = hm.id
I want to INSERT a record in a database using JDBC in OBJECTSCRIPT. At the same time, I want to obtain the insert ID. Is there a way to achieve this using the SQL Outbound adapter?
My code is something like this now:
Property Adapter As EnsLib.SQL.OutboundAdapter;
set sql = " INSERT INTO Prenotazioni_CUP "_ " (ID, cf " VALUES (SEQTAB.NextVal, ?) " set status = ..Adapter.ExecuteUpdate(.rs, sql, pRequest.cfAssistito)
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:
I am using %Library.ResultSet to execute my query which I have something like this. Query GetABC() As %SqlQuery [SqlProc]{
}
After I execute this query and a resultset it returns from this. Now What I want to know is the SQL statement which will have the values dynamically added into while execution.
1. The %ObjectSelectMode is working perfectly in the DynamicSQL for the object property in direct query. However this is not supported for class query. Is there any way to resolve this / Get the object value for class query result.
I have setup an async reporting mirror member with Read only access. My problem is that if I try to do any sql reporting against that data I am getting errors. I am sure that this is because the DB is read only, but I had assumed that setting up a reporting mirror would handle this.
I was wondering if the below query could be enhanced to automatically look back 24 hours from the current datetime the query is run. As is now I, of course, have to update the date range in the WHERE clause manually.
The query is just getting all MessageBodyClassNames, counting them and then doing an AVG on TimeCreated and TimeProcessed. Nothing too complex.
SELECT MessageBodyClassName, count(ID) as Count_Of_Messages, avg(datediff(ss, TimeCreated, TimeProcessed)) as avg_processing_time_in_seconds
Hi, I'm a student, weak programming. I ask for your help, I write a program in C #, there are two tables, but I do not understand how to organize the connection between them many to many. Table in DataGridView1 from DataSet1 on Form1 key connection in DataGridView1 from DataSet1 to Form3
I have a lookup table and record batch Table I would like to do a count on the records stored in that batch by counting the number of records in that batch that have a certain key on the responseKey column. This column keys are stored in the look up table for comparison. So I would like to do a join sql pivot that will use my keys stored in the lookup as columns and count as values
so far I have managed to do this but this is not efficient I would like to fire that sql once not on every count
I have several stored procedures that when I execute them they will only return a single snapshot. In my BP I have been setting this to a Snapshot variable then looping using a WHILE through the snapshot variable just to get that single value.
Since it is only a single row, is there an easier way where I don't have to do a WHILE loop to pull the values out of that row? Can I call First Row or something like that to get me just the row into the Snapshot variable?