Hello everyone!
I am writing a SQL CALL (using JDBC) to a stored procedure that outputs a structured object (Oracle Object).
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
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.
Hello, first question for me:
Is there a way to use a class Parameter in embedded SQL without having to declare a local variable, in a similar way to how it is done with Property by preponing i% as described here. See my example:
Class Test.Test Extends %RegisteredObject { Parameter MyParam = "1"; Property MyProperty; (...) Method PerformQuery() { set myParamLocalVar = ..#MyParam //this is what I would like to avoid &sql(SELECT * FROM MY_TABLE WHERE MY_PROPERTY = :i%MyProperty AND MY_PARAM = :myParamLocalVar) (...) } }
I am experiencing a problem with an EDI process that uses a SQL Batch Service to connect to our DEV environment. However, when we point the EDI service to our TEST server, it errors out.
I have checked every single property on our TEST and DEV servers as well as the properties on the associated tables. They are identical. Nothing has changed in the SQL either.
The EDI is a PUBSUB that generates X12 834s for various vendors. The SQL Batch Service is running a modified code that executes a stored procedure.
I'm running SQL reports on some HL7 messages and need to report the raw content of both the outbound message and the ACK response.
When looking in a Visual Trace at an I/O (Ens.Util.IOLog), under the Header tab it lists "InObject" and "OutObject" as each having values - in the example I'm looking at, the OutObject value is the EnsLib.HL7.Message ID I need for the outbound message, and the InObject value is the EnsLib.HL7.Message ID I need for the ACK response. My thought was that I could query that class via SQL and do two joins on the EnsLib_HL7.
I can refer to the TracerName for a given ImageFile object with the following syntax: obj.Study.Injection.GetAt(obj.InjKey).RadioTracer.TracerName
Is it possible to write an SQL statement to search the PET.ImageFile table to find a match based on the RadioTracer.TracerName?
SQL gateway. 'Locking' problem.
while debugging, is there in Caché a command to 'unlock' the instance of a class ?
close class, and kill class is not enough.
same problem in %Activate link
for each debug I have to exit (Halt) the terminal,
make debug in C#
coming back , and re-load again in Caché.
Regards,
Emanuel
Hi, Community,
This post will demonstrate how to display data on the web by using Embedded Python , Python Flask Web Framework and Jquery datatable
We will display processes from %SYS.ProcessQuery table.
<table id="myTable" class="table table-bordered table-striped">
</table> <script>
$(document).ready(function() {
// parse the data to local variable passed from app.py file
let my_data = JSON.Hi developers!
As you probably noticed in IRIS 2021 the names of globals are random.
And if you create IRIS classes with DDL and want to be sure what global was created you probably would want to provide a name.
And indeed you can do it.
Use WITH %CLASSPARAMETER DEFAULTGLOBAL='^GLobalName' in CREATE Table to make it work. Documentation. See the example below:
Hey developers!
Sometimes we need to insert or refer to the data of classes directly in globals.
And maybe a lot of you expect that data structure of global with records is:
^Sample.Person(Id)=$listbuild("",col1,col2,...,coln).And this article is a heads up, that this is not always true, don't expect it as granted!
Hey Community,
See how cubes are constructed for use in business intelligence, and learn about SQL and MDX query languages. Physical and virtual cubes are used in InterSystems IRIS® Business Intelligence and Adaptive Analytics:
Hi Community,
We need to export last 5 days Ens.MessageHeader data for a specific messages into file. I have written custom code to execute SQL query in object script.
Could somebody help me to iterate resultSet and write the data to text file.
Hi,
Management Portal SQL Interface
ERROR #5540: SQLCODE: -104 Message: Field 'QT.Fehlermeldung.parameter' (value '<params wert=\"\" feldName=\"Modul.name:...') failed validation
I've checked the syntax with some public tools with adjusted Tablename "Fehlermeldung" -> `Fehlermeldung`. It seems to be valid, but cache does not accept it.
INSERT INTO "Fehlermeldung" VALUES (1001021,'qsDataFieldOutOfRange','10','Der Wert ''<wert>'' des Datenfeldes <feldName> \"<feldBezeichnung>\" ist <artDerAbweichung> als <feldBound>.','<params wert=\"\" feldName=\"Modul.name:Bogen.
Hi everyone, i cant understand what is wrong in my query:
ALTER TABLE MyNamespace.MyTable ALTER COLUMN CurrentColumnName RENAME NewColumnName
I just want to rename column name using sql.
I could not find any life example using this syntax.
SQLCODE for this query is -25:
-25 Input encountered after end of query
Quote from documentation:
In this article I will explain the usage of %SQL_Diag.Result and %SQL_Diag.Message table along with all-new LOAD DATA functionality.
It is recommended to go through LOAD DATA documentation first.
After successful operation LOAD DATA insert one record in %SQL_Diag.Result table and details are inserted in %SQL_Diag.Message table
Below is the basic command when table is already created and source file does not contain header row.
LOAD DATA FROM FILE 'C://TEMP/mydata.txt' INTO MyTable
The file name must include a .txt or .csv (comma-separated values) suffix and both source and target have the same sequence of data columns.
We recently encountered an Embedded SQL issue while upgrading to IRIS 2021.1, and thought the issue and workaround might be interesting to share.
Key takeaway: Host variables in an ORDER BY clause of an embedded SQL query that is inside of a method don't work as expected. IRIS versions starting with 2020.1 are affected. As a workaround, add the host variable to the Method's PublicList list and "new" them so the embedded query has access to them.
How to execute it from the command line? I am able to use SQL in Management Portal, but I need to do it in Unix
select * from Ens_Util.Log where ConfigName='SFTPTo.HQ.SAFETRACE.DFT' AND Text LIKE '%Put Stream%' and TimeLogged LIKE '%2021-10-16%'
Application to import 12 Datasets along with 43 tables dynamically by using LOAD DATA command which loads data from a source into an IRIS SQL table.
List of Datasets
II try to explore the new SQL LOAD DATA feature in SQL comparing it to SQL INSERT
I'm stuck at this point: INSERT INTO <table> (columns...) VALUES (.....)
allows having not just simple column references but also ALL Standard SQL FUNCTIONS (at least)
example:
INSERT INTO Test (ShortName,DOB) VALUES (SUBSTRING(Name,1,4),TO_DATE(displayDate,'MM-DD_YYY'))
This works perfectly.
BUT the same VALUE clause applied to LOAD DATA fails in various ways:
LOAD DATA FROM FILE
Problem to Solve: When an HL7 message hits a particular Process, I need to use the placer order number therein to query the messages that came in over the last 24 hours on a particular Service and grab discrete pieces of data that came in the latest message that has that placer order number.
The code I'm (currently) using looks like this:
<assign property='FullMessage' action='set' value='"PID||TEST"' />
<sql>
<![CDATA[SELECT Full_Message INTO :FullMessage, head.ID As ID, {fn RIGHT(%EXTERNAL(head.TimeCreated),999 )} As TimeCreated,
head.SessionId As Session,
head.I have csv date file with date values like this "4/10/2021" for April 10, 2021. I defined a table with this property: Property TranDate As %Library.Date.
I capture error
[SQLCODE: <-104>:<Field validation failed in INSERT, or value failed to convert in DisplayToLogical or OdbcToLogical>] [Location: <ServerLoop>] [%msg: <Field 'dc_data_finance.transact.TranDate' (value '4/10/2021') failed validation Field ...
I do not really want to change TranDate to %String. How can I import "4/10/2021" into %Date property?
I read under Topics and Rules of InterSystems Datasets Contest:
I created a class “dc.data.finance.transaction”. I expected that it would not compile, because I remembered “Date” was a reserved word in SQL, and one of its properties was named “Date.” To my surprise, the class compiled successfully. When I tried to execute query “select * from dc_data_finance.
I have a csv file with 13 columns.
The header row is:
"Date","Check","Merchant","Category","SubCategory","Memo","Credit","Debit","Bill Pay","Debit Card","Account","Balance","Status"
The first data row is:
"","","","","","","","","","","Cash","56",""
I have created a SQL table to LOAD DATA into. When I ran
LOAD DATA FROM FILE '/irisrun/repo/data/finance-transactions-08-Jan-2022_08-25.csv' into dc_data_finance.transact
I got Cash into “Account” property (correct) and I saw 56 in “Status” property. I want to skip the “Balance” column.
Is there some generic way to output a %SQL.StatementResult to CSV?
What is the correct data type for decimal numbers precision 5?
I tried %Numeric with Scale 5, but not worked, see:
Is it possible to call java programs inside SQL statements, like the new LOAD Data, or is this just internal?
Hi all,
I try to build a little project for the dataset contest, you can find it here on github: Openflights dataset
My plan is to use just plain SQL. So I've made a few experiments with the new feature LOAD DATA.
Unfortunately all loads produce errors like:
Error: [SQLCODE: <-400>:<Fatal error occurred>]
[Error: <<UNDEFINED>zExecute+83^%sqlcq.OPENFLIGHTS.cls4.1 *%qparsets>]
[Location: <ServerLoop>]
The statements I use looks like this:
This happend with the preview release "IRIS Version 2021.2.0.617". While this error occurs, most rows are written to the database, but some rows are missing.