I want to INSERT a record in a database using JDBC in OBJECTSCRIPT. At the same time, I want to obtain the insert ID. Is there a way to achieve this using the SQL Outbound adapter?
My code is something like this now:
Property Adapter As EnsLib.SQL.OutboundAdapter;
set sql = " INSERT INTO Prenotazioni_CUP "_ " (ID, cf " VALUES (SEQTAB.NextVal, ?) " set status = ..Adapter.ExecuteUpdate(.rs, sql, pRequest.cfAssistito)
Hi, what is the easiest way to clear all the tables which store FHIR data? The most straitforward approach is to get a list of tables using the information_schema.tables view, then execute dynamic SQL with the "delete from" clause, but perhaps some helper class has already been written for this purpose?
https://www.youtube.com/embed/f7A-wbNkIic [This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]
Hi all, I am trying to execute a query like the below code. set statement = ##class(%ResultSet).%New("some_class:query_method"). // here query method is empty and with rowspec some columname
statement.Execute(param1)
I want to fetch data type of column value returned from above. eg - Name - VARCHAR, amount - INTEGER etc. How can I get it. Or if not possible directly. Is there any other way to validate or get datatype of values returned. Line we have type() in python3
From time to time we develop an Ensemble Production with simple SQL Inbound data from external databases, we need to develop a few new classes. There are at least:
This applies to embedded and dynamic SQL queries in Caché ObjectScript. If I attempt to terminate the process via Management Portal, nothing happens. Neither does Ctrl C nor closing the terminal window in which my program is running, nor setting a stop flag in a global which is read by the program on each loop iteration. The only way to stop the query appears to be restarting the Caché server (which is running locally on my PC).
One of the reasons why I love Cache and Iris is that not only you can do anything you can imagine, also you can do it in a lot of different ways!!.
Imagine that you have an integration running with IRIS connected by ODBC you probably only run SQL queries but you can also create stored procedures and inside write the code to do everything you can imagine.
I'm going to give you some examples but the limit is your imagination!!
https://www.youtube.com/embed/N9QnVx_GLvk [This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]
Hello, we have a few hundreds of triggers to port from Oracle to Cachè for a migration project, and many of them have to change (for example, normalize a value, null it, etc) the value which is being inserted.
The documentation says "You cannot set {fieldname*N} in trigger code." , so we're unlucky.
Is there a good workaround for this ?
SqlComputeOnChange doesn't seem the best way, but I'm not totally sure: for example normalization and validation could have a better place somewhere else than a trigger.
I have an ObjectScript class with a Log property of type %Stream.GlobalCharacter. I need to search the end of each of the logs - is there a way to extract the last 10 lines of the Log stream for each object via SQL? Or is my only option to write an ObjectScript routine to walk the table and inspect each Log property one by one?
I am having an intermittent issue that when I make a call to MSSQL from a BPL that the response does not come back in the amount of time required. Since the call from the BPL is synchronous I tried changing the timeout to 60 but it has not helped (see below). Is there anyway to guarantee that the call waits long enough for a response before continuing on?
I have some problem with inserting date to table using dynamic sql.
I have Country class. This table has relationship with class Continent as parent and child. In addition I have another statistic class where property Country has type of Country class. I get ID such as "1||1" next I execute dynamic sql INSERT INTO Stats(Country) VALUES("_CountryId_"). Then I select Stats table and see that value of Country column is "11") As a result a can't get Country object.
There is an interesting new feature in the recently announced 2024.1 preview, JSON_TABLE. JSON_TABLE is one of a family of functions introduced by the 2016 version of the SQL Standard (ISO Standard, published in early 2017). It allows for JSON values to be mapped to columns and queried using SQL. JSON_TABLE is valid in the FROM clause of some SQL statements.
The syntax of JSON_TABLE is quite large, allowing for exceptional conditions where the provided JSON values don't match expectations, nested structures and so on.
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}
Hello, is there a way to reset all of the Sample Classes back to their "Installed State."? In other words, delete all the other classes I have put into the samples namespace and leave only those classes that were there when I installed the instance.?