How can we insert into a table using a stored procedure?

Table structure :

CREATE TABLE SampleHospital (
Hospital VARCHAR(50),
Location VARCHAR(50),
UserName VARCHAR(50),
UserFullName VARCHAR(70),
LoginCount int)

Procedure Name:

call Custom_MENS_Other.samplesp('2021-11-02','2021-11-04','H001')

0 2
0 129


I am trying to input an entire xml into a sql server table. I am doing this via an operation in Ensemble.

I keep getting the following error

[SQL Server]XML parsing: line 0, character 0, unrecognized input signature

I have setup the table with a column parameter XML.

Here is the request object that is being sent to the store procedure

0 0
0 142


I have a question regarding SQL insert/update from the mananger portal's SQL window.

I am trying to do an insert with a value that contains multiple spaces ($32) between two words. This is needed for a comparative reason. But the spaces are automatically trimmed away all the time. How should I write to keep these?


Insert into TableA
(MyColumn) Values('xxxx yyyy')

then the spaces are trimmed away and it becomes: 'xxxx yyyy'

But I want to keep the spaces. How do I get around the problem?


0 4
0 137

Hi ,

When I use jdbc driver to query the column info ,the "REMARKS" field always show the same as the "COLUMN_NAME" field.

When I use the sql "select * from INFORMATION_SCHEMA.columns a where a.table_name='some table name ' " to query columns info,there has a "DESCRIPTION" field ,the value is some comment for the current field.

So is there anyway to return the description to the jdbc remarks field? And is there anyway to update the desciption or remarks field? Or is there some other way that I don't know to manage column comment info?

0 1
0 197

I running a query and get the results inside a result set. Now I have to iterate through the result set many times. From the doc I've seen only the Next() method. Is there a way to reset the cursor? Otherwise what is a good data structure to save multiple rows of a table?

My code in this case is something like this:

set sql = "SELECT * FROM MY_TABLE WHERE X= '"_Y_"'"
set status = ..Adapter.ExecuteQuery(.rs, sql)
// somehow iterate the rs more than one time

0 6
1 833

Hi, we are trying to run a dynamically generated Oracle Insert SQL script using Do $SYSTEM.SQL.DDLImport("Oracle",""," sql.txt",[Error Log]) to insert multiple rows into a Linked Table within HealthConnect to an Oracle database.

We have tried using statements that are accepted within Oracle but not when using Intersystems DLL along the lines of :

0 4
0 381

I am calling a stored procedure over an ODBC connection and every time I call it there are several warnings written to the log event {Found no Parameter 1 (used as 1) for query}.I seem to be getting this on every query executed and that seems to happen a number of times the query parameters are per query and its filling up my disc.

1) Is there a way to suppress these warnings as the query seems to be executed and data written to the database?

1 1
0 119


I'm trying to load some data into IRIS using LOAD DATA in the IRIS terminal however I am getting blocked by this error. I have read the documentation on this page trying to set up a gateway connection but get the same Connection cannot be established error.

This is what is in the %Java Server activity log

0 2
0 246

I have a table with a Varchar(max) column that I have created via the HealthShare SQL portal, and I see that in it's underlying class that column corresponds to a %Stream.GlobalCharacter

When I try to do a text search on that column (referenced as cd.Code in the example below) I get an error

0 1
0 134


We need a web-based SQL tool to connect to Ensemble/Cache, that will offer more functionality than what the Management Portal offers.
It needs to be web based, so that we can host it on a machine that has connectivity to the server via the superserver port. We (the devs and support) only have browser access to the environment via Remote Desktops, hence the requirement.

Has anyone gotten OmniDB to connect to Ensemble/Cache? If so, can you please advise on how to configure it?

Any other suggestions for such a tool are also welcome.

0 1
0 199
· Jul 17, 2018
Cache Dynamic SQL Pagination

Would like to know if there is an alternative or better way to paginate through a dataset using dynamic SQL than what I am using below. The problem is that as the potential pool of data gets larger, this code slows down to the point of not being useable. In analyzing each line of code below, it appears the slow down is related to the initial rset.%Next() iteration. Is there anything available which does not require a subquery/%VID such as a simple LIMIT/OFFSET?

My code is similar to :

s sql=##class(%SQL.Statement).%New()

1 25
2 2,352


Is there a way to find the median in Intersystems Cache SQL? I know it is not available as an aggregate function. Also in SQL Server I could try something like:

   (SELECT TOP 50 PERCENT Score FROM Posts ORDER BY Score) AS BottomHalf)
) / 2 AS Median

However, there is no PERCENT Keyword in Cache as well. Any suggestions?


0 4
0 279