Dear Experts,

I have to pull out a report of certain code tables and this is my first script and I need to write many.

1. If I have to refer to the table, seeing the reference in the components with reference to SQL table and column,

can I use Select < What I need from the table>

Inner join with reference table?

I tried, I used the code table reference in the components, but I am getting errors,

0 3
1 237

Hi,

When for any particular reason I need to update a record and don't want to pull the triggers, the keyword %NOTRIGGER can be used. But I've been trying to do the same when I change the row using the object approach, but I can't find it. Anyone knows if it's possible to avoid pulling triggers when working with objects?

Sadly, the utility "DISABLE^%NOTRIGGER" doesn't seem to exist ;-)

Thank you,
David

1 2
0 228

Apologies if this isn't the correct forum but here goes..

I'm accessing an Intersystems database from MS SQL Server using Intersystems ODBC driver and using OPENQUERY statement to read metadata of tables using

SELECT * FROM OPENQUERY([<linked server name>], 'SELECT * FROM INFORMATION_SCHEMA.COLUMNS')

but I get an error message saying INFORMATION_SCHEMA.COLUMNS cannot be found.

Intersystems SQL documentation does reference this table so is there some other way to access this table or is it maybe a permissions issue?

0 3
0 550

Hello All

I'm running into an issue performing UPDATES that I'm not getting on INSERTS. It's probably obvious, but I'm just not seeing it and could use a little help.

I'm going over an HL7 message and depending upon varying criteria, the relevent variables will get items added to them like the following:

Set patientId = pRequest.GetValueAt("PID:3")
Set sqlColumns = sqlColumns_",patient_id"
Set sqlValues = sqlValues_",?"
Set par($i(p)) = patientId

After compiling the variables, I check to see if accession number is found in the table.

0 14
0 356

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 expect it should flow like this...

SELECT UNIQUE SUBSTRING(RawContent, (FIND 3RD PIPE),(FIND 4TH PIPE) as NameDesc ....

0 1
0 204

Hello,

I am trying to work out if there are any methods available to be able import a result set returned by SQL query into a persistent class.

I have to connect to some legacy SQL databases through SQL Gateway and run some queries. I need to inster the rows returned into a class to then be able to do a %JSONExport to produce a JSON object. I know I can iterate through the resultset and insert one row at a time into the class but was wondering if there is any other/direct way of importing the resultset rows into a class.

Regards,

Utsavi

0 1
0 257

I have created a custom role in IRIS for users to provide limited view-only access for querying tables in the HSANALYTICS namespace. WinSQL has been installed on a Windows server (WinSQL Lite version 14.0.244.784) and an ODBC connection entry has been created in WinSQL for the users to log in and run SQL queries. The custom role provides the roles/resources included in the attached file. The WinSQL System DSN entry defined is:

Health Insight UAT HSANALYTICS 64-bit InterSystems ODBC35

The ODBC35 driver is defined as:

0 7
0 449

Hello,

We have a need to track Database changes over time - down to the SQL level of granularity if possible. Such as: User xyz runs routine ^abc and we get something similar to a changelog that tells us: table A had this value updated, insert, update etc....

Is that possible using IRIS level tools (Audit Log, Journal File, etc...) , is there a way to convert the global sets and kills from the journals into SQL level changes?

1 3
1 371

I am trying to populate a table using the sql Data Import Wizard. The input file is a tab delimited text file. But the import keeps failing with a 104 error showing validation for the columns which use %Library.TimeStamp and %Boolean datatypes is failing. Yet when I insert values into the table through a SQL insert command, the values get saved correctly in the table.

For the TimeStamp format in the wizard form, I am choosing YYYY-MM-DD-HH:MI:SS because there was no option for this format: YYYY-MM-DD HH:MM:SS.

0 4
0 291
Question
· May 27, 2021
JDBC counts don't match

I'm using a JDBC driver to connect PGSQL -> Cache. I'm noticing when I run SELECT queries and COUNT(*) command against the same table, I get different result sets. I'm pretty new to Cache in general - so I'm trying to understand why these would be different.

Examples (TransID and InvNum should occur in every "row"):

SELECT COUNT(*) FROM ACCT.Services = 1,090,324 WHERE ACCT.Dept = 483

SELECT TransID FROM ACCT.Services = 1,085,776 WHERE ACCT.Dept = 483

SELECT InvNum FROM ACCT.Services = 586,023 WHERE ACCT.Dept = 483

0 8
0 176
Question
· May 12, 2021
Cache sql query

Hi ,

I am trying to retrieve the contact type column data of a patient based on the recent date as shown below.

for instance

contacttype Datefrom

contact 1. 24/03/2020

contact 2. 20/05/2021

i need to retrieve the second contact2 based on the recent date.

i tried like below but not working .

Case max(datefrom) >0 then contacttype

End as contacttype

Can anyone please tell me why this is not working.Any other options?

Thanks

jude

0 3
0 258

I need to show the absence of data, so I have to join the list of predefined values with a result of a select statement.
However, it seems like Table Value Constructors in JOIN are either not supported, or I do not understand the syntax.
Basically, I am going for something like this:

Select v.valueId, m.name 
 From (values (1), (2), (3), (4), (5)) v(valueId)
     left Join otherTable m
        on m.id = v.valueId

Is it supported in Cache SQL or not?

0 6
0 166

Hi,

I'm getting thousands of errors like the ones below:

2021-05-03 14:11:44 [SQLCODE: <-400>:<Ocorreu um erro fatal>] [Cache Error: <<READ>Dispatch+14^%SYS.BINDSRV>] [Location: <ServerLoop>] [Client info: <Username: KIORAS, Node Name: 3IK0VLS5UU, IP Address: 192.168.1.223, Executable Name: EXTRService.exe, Internal Function: B0>] [%protocol: <52>] $Id: //ce/2018.1.2/kernel/common/src/aclass.c#1 $ 23468 104

0 1
0 458

The boss (reasonable intelligent ;-) wants to connect to the cache database through Excel, but unless I explain what he's looking for (field names DB names etc) then I can see him continually coming back for "what's the link here and how do I get the delivery company name etc etc"

is there a SAFE way I can give him access to our database using an intelligent visual user interface.

I had thought about the SQL Query Builder within the management portal, but the thought of giving him access to all of the other functionality of the management portal.

0 3
0 226

Hello everyone!

Some time ago, I changed the configuration in SQL Runtime Statistic to "Turn on Stats code generation to gather stats at the Open and Close of a query". With this change, the CACHE base (cache/mgr/cache/) has grown a lot to reach 198GB.

Yesterday, I returned the configuration of SQL Runtime Statistic to the default which is "Turn off Stats code generation" and the cache base is no longer growing.

My question is?

0 3
0 166

Following instructions on this page https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=D2IMP_... I am trying to create a Data Connector to be used as a base class for a cube with update support.
That page suggests that putting an SQL query inside XData block is not suitable for a Data Connector that supports updates.
Later it also suggests that to enable updates your SQL query must include

0 2
0 219

Hello everyone,

First, thanks in advance for your help :-)

I noticed that a query called directly in a method of a class of a business operation does not return the same result as if I apply the same query in the same Caché database from Squirrel !!!

I don't understand why ???

Here is the query :

0 4
0 226