Hi all
I'm struggling to insert into a table, and it is baffling me. The insert statement is now very simple (I was using a complex INSERT SELECT statement but I'm trying to narrow down the problem).
Insert statement:
INSERT INTO Phu_Replay_Schema.
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
Hi all
I'm struggling to insert into a table, and it is baffling me. The insert statement is now very simple (I was using a complex INSERT SELECT statement but I'm trying to narrow down the problem).
Insert statement:
INSERT INTO Phu_Replay_Schema.
Hey Community,
Don't miss the latest videos on InterSystems Developers YouTube channel:
In the good old days (tm) determining the size of the data, streams, and indices for a class/table was easy - you just ran %GSIZE and check D, S, and I globals respectively.
However, nowadays sharding, optimized global names, and indices in separate globals produce %GSIZE output looking like this:
Global Size Display of /irissys/data/IRIS/mgr/irisshard/
1:35 PM Dec 02 2020
IRIS.Msg 1 IRIS.MsgNames 1 IRIS.SM.Shard 1
IS.DGoWeK.1 24359 IS.DGoWeK.2 3 IS.DGoWeK.3 2810
IS.DGoWeK.Thanks to @Yuri Marx we have seen a very nice example for DB migration from Postgres to IRIS.
My personal problem is the use of DBeaver as a migration tool.
Especially as one of the strengths of IRIS ( and also Caché) before is the availability of the
SQLgateways that allow access to any external Db as long as for them an access usinig
JDBC or ODBC is available. So I extended the package to demonstrate this.
I would like to capture any NACK's that is sent back to the Operation. The Operation is already setup to "Save Replies/IndexNotOK's", but I would like to see if we can query Cache and pull those NACK's into an extract.
Is this possible?
Thanks
Scott
Hi Guys,
So I've been following this guide in using a %Library.ResultSet with a ClassName / QueryName as described in the first example.
https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic…
The code I've got so far doesn't work and is as follows:
set rs=##class(%ResultSet).%New()
set rs.ClassName="GMECC.DocmanConnect.Tables.vwNewGPs"
set rs.QueryName="GetRows"
set sc=rs.Execute("a") If $$$ISERR(sc) Do DisplayError^%apiOBJ(sc) Quit
while rs.%Next() { do rs.%Print() } And the referenced class is
Class GMECC.DocmanConnect.Hi, what’s the best way to check if your query return 0 records?
If $$$ISOK(sc)
{
Set tResult = sqlStatement.%Execute()
WHILE tResult.%Next()
{
set tRecords = tResult.%ROWCOUNT
}
if (tRecords = "")
{
write "no records"
}
}
Client: Northwell Health
Role: Senior Developer
Location: Remote
Duration: 6+ Months
Description:
Team Overview:
The FHIR Platform team is tasked with providing the core infrastructure in providing access to Northwell HIE patient data complying with HL7 FHIR and USCDI standards.
Position Summary:
The primary purpose of this role is to provide technical design, coding, testing and documentation for multiple components in the FHIR solution.
Responsibilities:
• Develop end-to-end solutions, participate in code reviews, unit test and deploy.
Hey Developers,
See how you can get high-performance relational access using SQL to manage data within your InterSystems products:
Hi,
We need a web-based SQL tool to connect to Ensemble/Cache, that will offer more functionality than what the Management Portal offers.
It needs to be web based, so that we can host it on a machine that has connectivity to the server via the superserver port. We (the devs and support) only have browser access to the environment via Remote Desktops, hence the requirement.
Has anyone gotten OmniDB to connect to Ensemble/Cache? If so, can you please advise on how to configure it?
Any other suggestions for such a tool are also welcome.
Kind regards,
Stefan
Hi folks!
Sometimes we need to import data into InterSystems IRIS from CSV. It can be done e.g. via csvgen tool that generates a class and imports all the data into it.
But what if you already have your own class and want to import data from CSV into your existing table?
There are numerous ways to do that but you can use csvgen (or csvgen-ui) again! I prepared and and example and happy to share. Here we go!
Recently our team have been getting requests to pickup a large amount of data from API nightly (e.g. using ODATA to loop through pages) and placing that into MS SQL databases.
My question is, what is considered the best practice to get data from API and route to external SQL database WITHOUT persisting any messages/traces etc?
At the moment my thinking would be to write a service that triggers an action once a day to an EnsLib.HTTP.OutboundAdapter, then map the HTTP response into a linked table (via method to keep the operation clean that managed the gateway on the way in and out of the method).
Hi,
Is there a way to find the median in Intersystems Cache SQL? I know it is not available as an aggregate function. Also in SQL Server I could try something like:
SELECT ( (SELECT MAX(Score) FROM (SELECT TOP 50 PERCENT Score FROM Posts ORDER BY Score) AS BottomHalf) + (SELECT MIN(Score) FROM (SELECT TOP 50 PERCENT Score FROM Posts ORDER BY Score DESC) AS TopHalf) ) / 2 AS Median
However, there is no PERCENT Keyword in Cache as well. Any suggestions?
Thanks
Hi everyone,
How do you alter primary key on a table that has data?
Any example much appreciated.
Cheers,
Tom
Hi everyone, how do you run multiple quires?
I have tried couple of different ways, but not working.
SET sql = 2
Set sql(1) = "UPDATE QUERY"
Set sql(2) = "UPDATE QUERY"
Set sqlStatement=##class(%SQL.Statement).%New()
Set sc1=sqlStatement.%Prepare(.sql)
If $$$ISOK(sc1) {
Set tResult = sqlStatement.%Execute()
}
else{
$$$LOGERROR("Failed")
}
I have a linked procedure class and SQL gateway setup and I can't seem to get any response, status or error from using the stored procedure, I think it must be something big I'm missing to not even get a status.
Can someone see what my problem is please, any help would be very much appreciated.
Class generated by linked procedure wizard:
Include %occInclude /// Class dbo.
A question has come up that I am not finding the answer for. Does the daily purge process re-index EnsLib.HL7.SearchTable or other SQL tables? In looking at the purge process documentation I am not seeing anything that mentions EnsLib.HL7.SearchTable. Do we have to manually constantly re-index tables that we create? For example I created another search table based off of EnsLib.HL7.Search table, will I need to constantly watch this as it grows?
Hi
I'm using an embedded SQL statement with a a cursor-based Embedded SQL query that uses host variables in the where clause, however, what I'm doing doesn't seem to work. Can anyone help?
The code I'm using is
set tMessageName = "AssessmentsMessage"
set tIdentifier = "SectionCode"
set ID = 0
&sql(
Declare IDs Cursor For
select %ID
INTO :ID
from GMECC_DocmanConnect_Tables.I have a %Persistent class with properties that are of %SerialObject. I want to add an index to a property of the %SerialObject class.
Is this possible?
Hi!
I'd like to know if there are any issues if an index is inserted into a table without running the %BuildIndices() method.
It's important to note that data inserted before the index is not important for retrieval, so it's not a problem data inserted before the index don't show up in queries.
The reason why I'm asking this is that I'd like to avoid index reconstruction on big tables which I need to inser such index.
I'm using Cache 2018.1.
Thanks,
José
We are trying to track down the source of Orphaned messages and noticed that we are unable to query EnsLib.HL7.Message with any kind of WHERE or ORDER BY clauses in our SQL statement.
I know EnsLib.HL7.Message is a system table, but is there a way we can add additional Indexes to the table to make the query run better/faster without affecting the system?
Could anyone please explain why Caché has a %STARTSWITH function while it supports ANSI SQL "LIKE"?
thank you very much.
How do I use the LOAD DATA command as described here.
I have the following LOAD DATA statement:
LOAD DATA FROM FILE 'E://Temp/Values.txt'
into PARIS.UAGU_MNDOOUT1 (AHSU_ID, AHSU_UAG_ID)
Where do I run it? It doesn't work in the SQL Gateway, in the terminal, in an embedded SQL command.
What am I missing?
Hi Community,
New video is already on InterSystems Developers YouTube:
I'm new to cache, come from an oracle and sql server background. In oracle and sql server I could write basically a stored procedure like script and pass it in as text to the command to execute.
Example:
Below would be the _sqltext
DECLARE @Id INT;
select id into @Id from something;
if @Id = 9
BEGIN
do something
END
The _sqltext would work in sql server, what would be the equivalent for cache for it work?
I get a generic error when I try it with cache
using (var mdscmd = new CacheCommand(_sqlText, MyConnection) { CommandType = CommandType.Text }) {
}
Thanks
Hello everyone!
I am writing a SQL CALL (using JDBC) to a stored procedure that outputs a structured object (Oracle Object).
Since Caché 2017 the SQL engine has included new set of statistics. These record the number of times a query is executed and the time it takes to run.
This is a gold mine for anyone monitoring and trying to optimize the performance of an application that includes many SQL statements but it isn’t as easy to access the data as some people want.
This article and the associated sample code explains how to use this information and how to routinely extract a summary of daily statistics and keep a historic record of the SQL performance of your application.
I want to have a script that can run from the usual unix, linux, or aix command line. It has to be able to get into an irissession and use set statements to get data using sql. It seems like I'm in a catch-22. When I use the irissession SERVER command at the command line, I can't run a script. When I put the irissession SERVER command in a script, it won't run anything in the script after that.
My goal for this script is to get this information and put it into a file which I can then parse.
Use case: small in-house hospital systems that query patient demographics via SQL. The new PAS being implemented in the near future will only support query/response via HL7. SQL access is available but intended for reporting so up to 24 hours behind.
Probably the easiest option is to set up a database in Ensemble and keep it up to date via standard ADT feed. This is going to have quite a large footprint and has a risk of getting out of sync.
Another option would be to proxy the SQL queries in Ensemble and translate them to HL7 QRY messages.
I have a SQL query that I want to run against MS SQL from cache ensemble using the SQL outbound adapter. If I run this query direct from MS SQL Studio it take about 7 seconds MAX and returns about half a million rows. The row only contains one column it is a number all same size and if I run this query in the production in ensemble it takes for ever the production finishes without getting the response back. The same query run in cache outside the ensemble environment writing results to a file it returns results taking about 3minutes to complete.