Say I have a property in a persistent class that stores list of colours and I would like to query that field and return a list and be able to loop that list to get individual colours how will l go about achieving this I have tried something like this but its not working as expected

 &sql(SELECT colour INTO :colourList FROM favouritecolours)
 While (SQLCODE = 0) 
{
 for i=1:1:$LENGTH($P(colourList,","))
 {
 set fvalue=$P(colourList,",",i) 
write "the first"_fvalue,i, 
} 
}
0 1
0 460

Hi!

I was trying to create a query that can be exposed as a stored procedure (function actually) that would return a resultset with a random number of columns.

Unfortunately, it seems that unless I specify the ROWSPEC annotation on the Query method, I won't get any columns exposed. I was hoping to implement QueryNameGetInfo method and specify the names and number of columns I would be returning dynamically. But it seems that GetInfo information is simply ignored.

Here is my code:

1 5
0 578
Question
· May 7, 2019
Linked Tables and Dialects

Hi! I've been fiddling with linked tables to get data from other servers, and I encountered a problem that I'm curious about. Maybe I'm not using these tools as intended or there's more going on, so I'm asking here.

I'm running a query on linked table A, something simple like this:

select name from A where id = 5983658923646

And I get this error:

[SQLCODE: <-400>:<Fatal error occurred>]

[%msg: <>]

0 6
0 486

Thanks for all replies in advance. We have a security vulnerability that we have to get rid of. We use Putty software to connect to cache as a terminal allowing several users to do maintenance work in cache. this uses telnet Plain text. I know that we can configure telnet to be encrypted using the super server service and I'm looking for software that can work like Putty as a terminal using encryption compatible with cache telnet encryption. If I have cache installed on my PC and setup a connection to the server using Kerberos with encryption and use the terminal option to connect to

0 5
0 810

Here is an ObjectScript snippet which lets to create database, namespace and a web application for InterSystems IRIS:

    set currentNS = $namespace

    zn "%SYS"

    write "Create DB ...",!
    set dbName="testDB"
    set dbProperties("Directory") = "/InterSystems/IRIS/mgr/testDB"
    set status=##Class(Config.Databases).Create(dbName,.dbProperties)
    write:'status $system.Status.DisplayError(status)
    write "DB """_dbName_""" was created!",!!


    write "Create namespace ...",!
    set nsName="testNS"
    //DB for globals
    set nsProperties("Globals") = dbName
    //DB for routines
    set nsProperties("Routines") = dbName
    set status=##Class(Config.Namespaces).Create(nsName,.nsProperties)
    write:'status $system.Status.DisplayError(status)
    write "Namespace """_nsName_""" was created!",!!


    write "Create web application ...",!
    set webName = "/csp/testApplication"
    set webProperties("NameSpace") = nsName
    set webProperties("Enabled") = $$$YES
    set webProperties("IsNameSpaceDefault") = $$$YES
    set webProperties("CSPZENEnabled") = $$$YES
    set webProperties("DeepSeeEnabled") = $$$YES
    set webProperties("AutheEnabled") = $$$AutheCache
    set status = ##class(Security.Applications).Create(webName, .webProperties)
    write:'status $system.Status.DisplayError(status)
    write "Web application """webName""" was created!",!

    zn currentNS

5 3
5 1.4K
Article
· Apr 9, 2019 3m read
IRIS/Ensemble as an ETL

IRIS and Ensemble are designed to act as an ESB/EAI. This mean they are build to process lots of small messages.

But some times, in real life we have to use them as ETL. The down side is not that they can't do so, but it can take a long time to process millions of row at once.

To improve performance, I have created a new SQLOutboundAdaptor who only works with JDBC.

BatchSqlOutboundAdapter

Extend EnsLib.SQL.OutboundAdapter to add batch batch and fetch support on JDBC connection.

3 7
2 1.4K
Question
· Apr 5, 2019
How to compare time

I am trying to get the time difference between two time stamps one is recorded earlier to the one happening current but the problem is sql expect string while I have the other stored in a variable and if I do the following I get errors any help please

&sql(SELECT {fn TIMESTAMPDIFF(SQL_TSI_HOUR,$ZDT($H,3,1,3),tx)})

please note that tx is a variable holding the time formatted the same way as the one being compared to

0 3
0 488
Question
· Mar 29, 2019
Ensemble as a Data lake

We have been storing raw messages in a MySQL database for DR and ad hoc purposes. We are thinking of using an Ensemble instance as our data lake instead. We could segregate the source data by namespace or by global. But either way we'll want a custom global to index the data for data retrieval performance purposes.

Anyone else taking this approach? Any feedback?

0 2
0 452
Question
· Mar 12, 2019
String to date

I am trying to convert a string to date but can not get it to work I have function that I would like to take in a date string and covert it to date object

here is the ezample so far can not get it to work any help appreciated

set p="12/03/2019"
 
w $System.SQL.TODATE(p,"YYYY-MM-DD")
 
<ILLEGAL VALUE>todate+32^%qarfunc

if I try this still get the wrong value returned

set p="12/03/2019" 
w $ZDATE(p,3)
1841-01-12
0 6
0 2.8K
Question
· Mar 4, 2019
Missing Mirrored Database

Hi guys

I've added a new mirrored failover member to an existing one.

They are both Arbiter controlled.

When I do Add database to mirror on the primary I'm always getting an error. Missing Mirrored database.

I followed everything in the documentation and always get the same error.

I've copied the CACHE.dat file after umounting the database on both servers. then mounted them.

Could you help me out?

Kind Regards

0 1
0 564

Good afternoon,

We have a very old version of Ensemble with one of our clients and they have no desire to upgrade anytime soon. We have gotten the all-clear to purge really old messages from the database, changing the days kept from 60 to 30. The option to Compact/Truncate is displayed in this version of Ensemble, but does not execute as it mentions not being actually present in this version.

There is an option in ^d DATABASE that restores unused space, however this does not return nearly as much free space as the refined Compact/Truncate procedure.

0 2
0 378

Is there a way or can it be done to use conditional logic in sql like so

 Query Q1(formal as %String) As %SQLQuery [ Final ]
{
    
    SELECT patientnumber,ID, CASE
    WHEN ID = 50 THEN "The is 50"
    WHEN ID = 30 THEN "This is 30"
    ELSE "The quantity is under 30"
END FROM Audit.Table WHERE ID = :formal AND EndDate is null} 

}

0 2
0 334

Edit:

May have found the issue but not the solution.

"SELECT * FROM wmhISTORYdETAIL" runs as a passthrough without asking for the DNS.

but

'SELECT Count([wmhISTORYdETAIL].[HistHMNumber] AS CountOfHistHMNumber FROM [wmhISTORYdETAIL] WHERE ((([wmhISTORYdETAIL].[HistMovType])='Receipt') AND (([wmhISTORYdETAIL].[HistMovDate])>=Date()-1) AND (([wmhISTORYdETAIL].[HistMovDate])<Date()));'

asks for the DNS but both are linked to a table that has the password saved.

Any Ideas please?

Rob

Hi

0 1
0 327
Question
· Jan 15, 2019
Why <UNDEFINED> on SQL

I have an sql statement that I would like to execute but I get the error

"zSearchChanges+5^MergeHyland.TypeTwoUtil.1 *KeyID"

and here is my sq

l  "&sql(SELECT Key INTO :KeyID FROM MergeHyland.TypeTwoDimesionalTable WHERE Key = :Key)" any ideas why 
0 2
0 201

Astronomers’ tools

5 years ago, on December 19, 2013, the ESA launched an orbital telescope called Gaia. Learn more about the Gaia mission on the official website of the European Space Agency or in the article by Vitaly Egorov (Billion pixels for a billion stars).

However, few people know what technology the agency chose for storing and processing the data collected by Gaia. Two years before the launch, in 2011, the developers were considering a number of candidates (see “Astrostatistics and Data Mining” by Luis Manuel Sarro, Laurent Eyer, William O’Mullane, Joris De Ridder, pp. 111-112):

Comparing the technologies side-by-side produced the following results (source):

Technology Time
DB2 13min55s
PostgreSQL 8 14min50s
PostgreSQL 9 6min50s
Hadoop 3min37s
Cassandra 3min37s
Caché 2min25s

The first four will probably sound familiar even to schoolchildren. But what is Caché XEP?

10 9
1 960

Hi

Totally new to IRIS and Cache.

Trying to evaluate it and work out how we could use it.

As a standard application database. Object or relational etc. does not matter.

Issue is ObjectScript.

So:

1) Can we develop, maintain and use an IRIS database and never use ObjectScript i.e. use only Java, Python, C++ interfaces etc. (exactly which one does not matter)? Would that make designing and using the IRIS database more prone to inefficiency and error?

2 4
0 788
Question
· Oct 3, 2018
CreateProperty with curl

Hello,

I have a question about creating properties with curl.

I already did create properties in Java with the following command.

<DO db.%CreateProperty("TotalSteps","%Integer","$.TotalSteps")>

It created the property TotalSteps with the type %Integer and the data path $.TotalSteps (since the header of my data source is also TotalSteps).

Now I would like to create the same property in curl with the following command

0 2
0 425