Hi Community!
Please welcome a new session recording from Global Summit 2017:
What's Lurking in Your Data Lake?
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
Hi Community!
Please welcome a new session recording from Global Summit 2017:
What's Lurking in Your Data Lake?
I am trying to fetch the data from cache database. But i got the error like "CSP application closed the connection before sending a responce".
Below is the query.
SELECT
CallbackComment
FROM SQ.CBPhoneResult_View Where PhoneDateODBC = '2018-04-09'
I have investigated and found that "CallbackComment" contains the special character single quotes " ' " for one result and due to this i got this error.
In this field data is enter by customer. so we cannot restrict them like Do Not use single quotes.
Please provide some solution as soon as possible.
Thanks in advance.
June 25, 2018 – Alert: Outer Join Query Results
InterSystems has corrected two defects that can cause SQL outer joins to return incorrect results. These defects can also impact DeepSee in Caché and Ensemble, as well as InterSystems Business Intelligence in InterSystems IRIS; in these cases, building and synchronizing some analytic models may result in build errors.
These issues exist on all platforms for the following released InterSystems Data Platform products:
I'm facing a specific sort problem.
There are several thousands of articles sold all over.
Users expect to get a description in local language sorted by their specific collation.
I have a serial object:
Class EmbedObj Extends %SerialObject
which is stored as a property of another object
Class ContainerObj Extends %Persistent
Property InnerObj As EmbedObj;
Property Foobar As %String;
Question:
From within the context of an instance of EmbedObj, how can I navigate to the containing instance of "ContainterObj" and find that value of its Foobar property?
Harder Question: Is there a way I can do this as part of SQLComputeCode? (my EmbedObj has a Calculated property which now needs to depend on the value of property Foobar of the containing object).
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?
Hello,
I want to know if there is any possible way to use the same query for different ODBC schemas.
Thanks.
Does anyone have any sample code for updating Caché users (and specifically Full Name and Comments) via SQL?
Bonus points for knowing specifically what security resource needs to be assigned to allow someone to run the SQL.
Thanks in Advance!
Ben
Without installing Kerberos has anyone Authenticated a SQL JDBC connection? Currently we are using local SQL Accounts to sign onto External SQL Databases, but we are being told that we need to switch to Service accounts that live on a Active Directory Domain.
I wrote with a little help a ZAUTHENICATE to do the Authentication for Ensemble, can I use something like that to connect to an External SQL Database using a Service Account on a Active Directory Domain?
Thanks
Scott
I have generated a class using the linked procedure wizard however I can't get it to work if the datatype of one of the parameters is VARCHAR(MAX). It works fine if I change it to say VARCHAR(500) and rerun the stored procedure wizard.
I get the following error returned.:
ErrorMsg: SQLState: (07002) NativeError: [0] Message: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error
Can anyone see what I am doing wrong? I think it is to do with the way I am using the %Stream.GlobalCharacter? Any help is much appreciated.
Hi All
I'm looking for the a simple-quick-easy solution to monitor a SQL table thought Ensemble.
I have a process that update a DataBase ,a scheduled task that runs every night (Not Ensemble)
In the end it updates a table (replica_status) with a new recored with two fileds: Id, DateTime
I looked around the community but didn't find an answerd case.
I'm thinking on a Task that will run a sql outboud adapter BO that checks that table and send a alert if no new record was created yesterday
is this the right approach or is there's a better solution?
Thanks Gadi
Hello glabal masters,
I am trying to develop WAS using Cache and Spring Framework.
The ON DUPLICATE KEY UPDATE is not working.
The documentation only provides the syntax but does not provide any sample DDL for this case.
I am modifying some DB2 queries to Cache SQL but always meet some errors, please provide a sample query for this case.
Thanks.
I have a SQL procedure that I call into and it does some processing and passes back any data validations that fail. I would like to receive those message in my operation and act upon the message received .The question is how do you get output messages from a stored procedure I am using MsSQL 2012 with ensemble
Hello Global masters!
I developed Web with Spring framework (JAVA, Jdbc Cache) and I wrote SQL when I made it.
And Window program with VB6, Cache Object and VisM.
Is there a significant performance gap? SQL and Cache Object?
same function, same computer performance just different Java and VB6.
Thank you.
Minsu.
Hello Global masters.
I am junior developer about Intersystems cache in South Korea.
I want to develop process management program on server.
My code :
TESTPID(IP) ;
#include %syPidtab
Set Rset = ##class(%ResultSet).%New("%SYS.ProcessQuery:ListPids")
d Rset.Execute()
&sql(SELECT ClientIPAddress, Pid INTO :ClientIPAddress, :Pid
FROM %SYS.ProcessQuery
WHERE ClientIPAddress = :IP)
While Rset.Next()
{
i SQLCODE'=0 w !,"SQL Error "_SQLCODE continue ; 100 means process does not exist (halted)
I Rset.GetData(1) = Pid D
. w !,Rset.GetData(1)," ",ClientIPAddress," ",Pid
//Set rs=$SYSTEM.Process.Terminate(Pid)
//If rs'=1 {
// Write "Terminate Fialure "_" Pid "_Pid,!
//}
//Else {
// W "Sucess",!
// }
// }
}
d Rset.Close()
QMy new question regards connecting to the external database to insert the data. I have the following code:
#include %occInclude// winsurge6// insert winsurge data into cancer registry database
Compiling routine : winsurge6.MAC
ERROR:winsurge6.MAC(30) : SQLCODE=-30 : Table 'WINSURGE_RESULT_FACT' not found within schemas: CANREG,SQLUSER
Detected 1 errors during compilation in 0.026s.
I'm not sure what this error indicates. I've tried a few different things regarding the #SQLCompile Path=canreg and the
&sql(WINSURGE_RESULT_FACT
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.
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
SELECT * FROM
(
SELECT tMatch.DataValue, Count(*)
FROM ResponseRMAP.Record bRecord
JOIN Match ON tMatch.TableName = 'Match' AND tMatch.KeyName = bRecord.ResponseCode
WHERE bRecord.%ParentBatch = 55
)
Hi,
The following sql statement is working through the SMP but couldn't make it work through the code.
The table is a linked table to oracle db.
Tried to change the date property in the linked table class from %Date to %String and also tried using %SQL.Statement and %Library.ResultSet
this work through SMP:
INSERT INTO PACKAGE.SOME_TABLE_NAME
(EFFECTIVE_START_DATE,MORE,DATA,HERE)
VALUES (to_date ('2018-04-01','yyyy-mm-dd'),123,456,789)
In the code i'm using '?' in the statement for the parameters.
How to convert SQL persistent classes to JSON output - I have tried 1 option but appears to be very lengthy process.
I have many other SQL storage's defined and have to expose them as well to JSON. Can anyone please suggest a better approach.
My column names usually match with my Json properties.
My User.TestClass is the class with GetJsonList() as my method to return /output JSON formatted data.
The Code tried and SQL storage structure are as follows -

Class User.TestClass Extends %RegisteredObject
{
ClassMethod GetJsonList() As %Status
{
Set SQL="SELECT ID, Column1, Column2, DataID FROM SQLUser.
This is a sample Ensemble/Health Connect production which demonstrates how to receive an HL7 order (ORM) inbound from a file, extract fields (in this case, basic demographic information), and insert those into a table in an external SQL database via ODBC.
Included in the zip file:
I am tasked with using CACHE to insert data retrieved from a CACHE data base and insert it into an sql database. The columns in the sql table that I am trying to insert data into have names that contain underscores such as "ACCESSION_DATE" I found a utility in CACHE to connect to the sql data base and perform inserts. I have the data I need to insert. I need to pass the data into the sql utility referencing the column names.
I tried using indirection to set the data into underscored variables, but that isn't allowed in cache object script.
Anyone have suggestions as to how to do that?
Will an upgrade from 2015.2 to 2017.1.2 or higher freeze the query plans from 2015.2? Is there some minimum source version where this will work?
Has anyone use any other setting then -1 on the Stay Connected setting on a SQL.OutboundAdapter? I am having issues with a particular database and wonder if it would be beneficial since I only connect once a day to read the data from the Adapter to create an HL7 message.
Thanks
Scott Roth
Morning guys I have a SQL operation that I use to read data and results to a record map. But seems to have trouble saving the objects to a record map as I get this message
ERROR ErrException:
zInsertObject+2^%Library.RelationshipObject.1 -- logged as '-' number - @''
please help here is my code let me know if I missing anything thank you in advance
Method OnRequest(pRequest As DQToolsSet.PrimaryMessageREQ, Output pResponse As HSCIC.DBS.RequestRBAT) As %Status
{
#dim status as %Status=$$$OK
#dim resultSet as %SQL.StatementResult
set pobject=##class(%FileCharacterStream).%New()
set preq=##class(HSCIC.DBS.RequestRBAT).%New()
set status=..Adapter.ExecuteQuery(.resultSet,..GetTheSubmissionData(pRequest.pMonth, pRequest.pApp, pRequest.pRef, pRequest.pInPat))
nbsp;if ($$$ISOK(status))
{
While (resultSet.%Next(.status) && $$$ISOK(status))
{
set ppResponse=##class(HSCIC.DBS.RequestRMAP.Record).%New()
set ppResponse.RequestCode=resultSet.Get("recType")
set ppResponse.PatientID=resultSet.Get("ClientID")
set ppResponse.DOB=resultSet.Get("DOB")
set ppResponse.Property4=resultSet.Get("u1")
set ppResponse.Property5=resultSet.Get("u2")
set ppResponse.NHSNumber=resultSet.Get("NNN")
set ppResponse.Surname=resultSet.Get("Surname")
set ppResponse.AltSurname=resultSet.Get("u3")
set ppResponse.GivenName=resultSet.Get("GivenName1")
set ppResponse.AltGivenName=resultSet.Get("u4")
set ppResponse.SpineGender=resultSet.Get("Gender")
set ppResponse.Address1=resultSet.Get("a1")
set ppResponse.Address2=resultSet.Get("a2")
set ppResponse.Address3=resultSet.Get("a3")
set ppResponse.Address4=resultSet.Get("a4")
set ppResponse.Address5=resultSet.Get("a5")
set ppResponse.PostCode=resultSet.Get("Postcode")
set ppResponse.AltAddress1=resultSet.Get("p1")
set ppResponse.AltAddress2=resultSet.Get("p2")
set ppResponse.AltAddress3=resultSet.Get("p3")
set ppResponse.AltAddress4=resultSet.Get("p4")
set ppResponse.AltAddress5=resultSet.Get("p5")
set ppResponse.AltPostCode=resultSet.Get("p6")
set ppResponse.GPCode=resultSet.Get("GPCode")
set ppResponse.GPPracticeCode=resultSet.Get("PracticeCode")
set ppResponse.NewField3=resultSet.Get("u5")
set ppResponse.NewFiel23=resultSet.Get("u6")
set status=ppResponse.%Save()
set pobject=ppResponse
set pResponse=##class(HSCIC.DBS.RequestRBAT).%New()
if ($$$ISOK(status))
{
set status=pResponse.Records.InsertObject(pobject)
set status=pResponse.Records.%Save()
}
}
}
}Hi all.
I have some problem with getting data from external source (PostgreSQL) via JDBC and load it in DeepSee and I resolved some problems while writing this question :)
So..Below I proved my steps of working:
S Connection=##class
Hi all,
I have an operation which uses the SQL outbound adapter to query a data source set up using a system DSN on the server which uses the Intersystems ODBC35 driver (this is a cache db hosted elsewhere).
Whenever Ensemble runs the following query:
SELECT lnkdid,
c_fastsearch_code,
c_drugfull
FROM JAC.drug_basic
WHERE c_drugfull LIKE 'Para%'
No data is returned, however running the same query via SQL Server Management Studio, all expected rows are returned.
Also if I run the following via Ensemble:
SELECT lnkdid,
c_fastsearch_code,
c_drugfull
FROM JAC.
I came across How to import a tab separated text file into a SQL table programmatically?, which appears to indicate that I can pass the filename and all records will be imported. However, when I put use the Import method only a single record gets imported. However, all records are imported if I use the management console to import the file by selecting it and choosing the options.
Has anyone ran into this in the past?