How to calculate median and mean in SQL?
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
How to calculate median and mean in SQL?
I configured a SQL inbound adapter to monitor my local Cache database.
But I got "ERROR <Ens>ErrOutConnectFailed: ODBC Connect failed for 'SAMPLES' /
'' with error ERROR #6022: Gateway failed: DSN/User Connect."
Same error if the DSN setting is blank or set to my namespace.
Question is whether SQL inbound adapter is for external database server ONLY?
Hello,
I've got a table with many attributes and data. There is 10 000 000 registrations approximatly.
I need to make a research on this table with filters, paging, and order.
You can see an example of my SQL request :
SELECT * FROM ( SELECT TOP ALL * FROM ANCV_Data.Titre WHERE etatTitre = 'Emis' ORDER BY numRemise desc) v WHERE %vid BETWEEN 1 AND 25
Cause there are many data on my table, my SQL req is too long if I don't have index on my attributes BUT there are many associations possible...
Are they any solutions ?
Regards,
I have the following class:
Class temp.test7 [ Owner = {PHOENIXDBUSER} ] { ClassMethod GetTenAssets() As %Status [ ReturnResultsets, SqlProc ] { s sc=$$$OK s sql="SELECT TOP 10 * FROM Data_Assets.Asset" s sqlStatement=##class(%SQL.Statement).%New() s sc=sqlStatement.%Prepare(sql) if $$$ISOK(sc) { s result=sqlStatement.%Execute() d %sqlcontext.AddResultSet(result) s %sqlcontext.%SQLCODE=result.%SQLCODE s %sqlcontext.%ROWCOUNT=result.%ROWCOUNT s %sqlcontext.%Message=result.%Message } else { s %sqlcontext.%SQLCODE=-460,%sqlcontext.%Message=##class(%SYSTEM.Status).
BridgeWorks is pleased to announce a VDM, v9.1.0.1.
Hello Community,
I would like to work in SQL developer with the tables from Caché.
Is it possible with JDBC tool?
What is the whole process in order to work in SQL developer? I have the access information to Caché, but i can only choose in SQL Developer software only Oracle or MySQL database type, therefore i think, that have to install any other tool.
Thank you in advance for your help!
br,
bálint
Does Caché have any features similar to PostgreSQL 'WITH RECURSIVE'? Something that allows recursion in SQL.
HI,
I have made a query with class definitions and all their properties and put them in a view.
All is good besides Parameters is showing junk characters. Is there a way to do it cleanly besides getting into the code??
SELECT
CC.ID As CompiledClass,
CC.SqlSchemaName,
CC.SqlTableName,
CP.Name As PropertyName,
CP.SqlFieldName,
CP.Type,
PD.Parameters
FROM %Dictionary.CompiledProperty CP
JOIN %Dictionary.CompiledClass CC
ON CP.Parent = CC.ID
JOIN %Dictionary.PropertyDefinition PD
ON PD.ID = CP.ID1
I have the following class:
{
Query ClosedFutures(FromDate As %Date, ToDate As %Date) As %Query(ROWSPEC = "FundCode:%String, Asset:%String, TradeDate:%Date,BuySell:%String, Price:Data.Common.Numeric, Quantity:%Numeric, CumulativePosition:%Numeric, PreviousCumulativePosition:%Numeric, ClosingTrades:%Integer, ClosingTradesInPeriod:%Integer, ClosedTradeValueInPeriod:Data.Common.Numeric, NetQuantityInPeriod:%Integer, WeightedClosedAverageTradePriceInPeriod:Data.Common.
Hello,
I work with Ensemble Business Operation with SQL Outbound Adapter. I try to query a DSN defined database that happens to be Cache on the same machine in the same instance of Healthshare 2017.1.3. This worked fine on Linux server when I used JDBC driver. Now I want to run it on my Windows 10 laptop. I set up DSN and I can test connection successfully. I provided DSN in Operation DSN setting and I tried with and without Credential. I get ERROR <Ensd>ErrOutConnectFailed: ODBC Connect failed for 'myDSN' / 'myDSN' with error ERROR #6022: Gateway failed: DSN/User Connect.
Hello InterSystems Community,
We're excited to announce that we've completed our first Open Exchange submission for InterSystems platforms.
BridgeWorks VDM is an ad hoc reporting and graphical SQL query builder application that was designed for any user who needs access to their SQL projections in InterSystems Caché, InterSystems IRIS, InterSystems IRIS for Health databases as well as access to InterSystems DeepSee and InterSystems IRIS BI Cubes with minimal SQL scripting experience.
Hello everyone, It is my first post in the community. Very recently I started working using IRIS, creating services with Cache. Today they gave me a new task and I'm really lost.
How can I use an oracle database to create services using iris?
Throughout the day I was looking for a guide to use a remote Oracle database. but unfortunately I only managed the connection in SQL Gateway
I am trying to make architecture for my project. And for it, it needs to make list property in which there is list of objects of another table, the data must be unique, therefore I make sql-query to check objects of another table if it is used or not, but I can't make sql-query to check elements in list in property with elements of another table. Can you help me? In property ID of object is used.
I have a database which needs to be synced to another system and considering to use the SQL Inbound adapter to 'watch' the database. The other system, however, has a bulk API so I'd prefer to send multiple SQL rows in a single message to that system. The SQL Inbound adapter seems to trigger a single call (to a process or business operation) per SQL-row. However, the documentation here: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY… in example 5 seems to suggest that if I exclude a KeyFieldName I get multiple rows in my EnsLib.
Is it possible to use a class parameter in class query?
Example:
Class SomeClass
{
Parameter SOMENAME = "Name1";
Query SomeQuery() As %SQLQuery
{
SELECT ID || ..#SOMENAME || Name FROM Table
}
}Hello everyone,
I try excuting a SQL Query like this SELECT ID, CompanyName FROM Company WHERE CompanyName LIKE 'condition'
But if I want to search CompanyName have special char %, ex: '100% Co' , 'Group of Mr.%', 'The %TaxProp'...
How can I take % to query, with
SELECT ID, CompanyName FROM Table1 WHERE CompanyName LIKE '%%%' it'll get all record in table.
Someone give me an idea. Thanks so much!
I have a task that has been working successfully for some time now but when I attempt to recompiled I get this error:
--------------------------- Studio --------------------------- ERROR #5475: Error compiling routine: ACLIB.Utils.PurgeOrphanedMessages:PurgeOrphaned. Errors: ERROR: source lines(38) : MPP5610 : Referenced macro not defined: 'vaExtentGbl' TEXT: .
Hi Community,
New video, recorded by @Stefan Wittmann, is already on InterSystems Developers YouTube:
We have in DB two books, first is loaned because it has the Friend ID, and the other is in the shelf.

I execute a class query to get all loaned books:
Query BooksLoaned() As %SQLQuery
{
SELECT *
FROM Library.Book
WHERE Friend IS NOT NULL
}
Which I have tested throught the portal:

My task is to retrieve all the loaned books and return them in an array. Method code:
ClassMethod GetLoanedBooks() As %ArrayOfObjects
{
set booksRS = ##class(%ResultSet).%New("Library.Book,BooksLoaned")
set rsStatus = booksRS.
Greetings community. I would like to know how to migrate a BD in production to a local environment. When I have a system in production (BD Sql Server) what we do is mount a local copy to do the analysis with the data and not occupy resources of the system in production. My question is: How do you do it with Intersystems technology? I already tested the PowerBi connector and it looks great, but that's where the question came up.
Hi guys,
I ran into a strange (for me) situation, when I run same query but change the WHERE clause the plan is different and is not connected to the additional condition.
Query that doesn't use the necessary index:
SELECT * FROM Portal.ProductStats ps left JOIN Portal.ProductCacheUpdates pcu ON (pcu.Item=ps.Item) WHERE ps.Item=?
Takes 0.4 sec, doesn't use index on item from Portal.ProductCacheUpdates table
SELECT * FROM Portal.ProductStats ps left JOIN Portal.ProductCacheUpdates pcu ON (pcu.Item=ps.Item) WHERE ps.Item=? AND ps.dateImported<pcu.dateEdited
Takes 0.
Can anyone tell me how to add a simple running total in Cache SQL.
I'm selecting a quantity in the first column and want a running total in the second:
9 , 9
2 , 11
7 , 18
Hello,
Is there a way to list all items in a production (incl their status/color) by using a sql query? This is for monitoring purposes.
Thank you in advance!
Regards,
Luk
"IN" does not work changing it to "=", "like" the stored procedure will work. Does any one know how to fix this ?
Pass values to code is 'AB','TS','SK','GM'
Query LoadData(code As %Library.String) As %SQLQuery [ SqlProc ]
{
SELECT STRING(Descrtiption,' (',Code,')') as Description,Code FROM Test.Codes
WHERE Code IN (:portCode)
}
Hi, we are a veterinary lab and we use both the LAB and FIN systems of Antrim. Now we are looking to expose the data in a SQL/Object compatible way so we were wondering if same / similar things had been done by other community members already? If so, could you please share your approach / experience / gotchas with us and we are all ears. I can be reached at yang.jiao@antechmail.com . Thank you!
At LifeLabs, we are focused on our vision of building a healthier Canada! We are the largest community diagnostics laboratory in Canada with over 350 collection centers, 21 laboratories and service over 19 million patients each year. As the Software developer, you will be concerned with all facets of the software development process. You will be responsible for the design of application modules, maintain and deploy software applications to meet user and business needs.
I know &SQL returns only one result but is
&SQL(SELECT ID FROM Cinema.Film ORDER BY ID DESC)
and
&SQL(SELECT TOP 1 ID FROM Cinema.Film ORDER BY ID DESC)
the same in terms of processing required?
Hi Everyone!
New video, recorded by @Stefan Wittmann, is already on InterSystems Developers YouTube:
When i use
How can i go through the full result once,like .%Display()? Or how should i do to go through the full result? Is there anyone can help me? Waitting
!!!