Follow Danny's advice above (or below, no idea where this comment will land) and if it turns out to not be straightforward, feel free to contact Support (, 617-621-0700).  One of us would be happy to log in with you and help you troubleshoot this. 

For what it's worth, enabling Auditing (after you change the System events for Protect and LoginFailure to be enabled) should tell you what the problem is pretty clearly.

As Robert C. said, the reason for this is because aggregate functions do not follow the rules of Read Committed mode.  Moreover, the way to tell if you have values or not is to check SQLCODE, not the answer.  For instance, even if you did:

&SQL(SELECT AttrA into :valA FROM Test."Table")

You could still find your value (1) in valA.  Your next line should ALWAYS be checking SQLCODE.  Without that check, you cannot be sure that the value in your variable is good.

This works for me.  I used this class definition:

Class Test.JDBCStream extends %Persistent

Property Content as %Stream.GlobalCharacter;


And the following query form SQuirreL SQL on Mac worked fine:

INSERT INTO Test.JDBCStream (Content) VALUES ('A long String')

So I'm not sure exactly what you're doing.  Do you have code?  Examples?  

As Len stated yesterday, you should open a WRC Issue.

Edit: Sorry this post looks bad, the text editor on this site is awful.

Moderator: fixed

Post Moderator Edit: Still looks bad, lost the syntax highlighting, and being able to edit people's posts kind of ruins the point of an open forum.

This is a good question - it causes a bit of confusion for those starting out with arrow syntax.  When you use -> you are doing what we call an "implicit join".  If you look at the docs here:

You'll see that an implicit join is a LEFT OUTER JOIN.  This is very different from an INNER JOIN as it will return rows from the first table whether or not the ON clause is satisfied.  Now, if your queries were:

1) SELECT Child.Name FROM Mother LEFT OUTER JOIN Child ON Mother.ID = Child.Mother WHERE Mother.Name LIKE 'A%'
2) SELECT Child.Name FROM Child WHERE Child.Mother->Name LIKE 'A%'

Then these queries would be exactly the same, and you should use the one that you find easier to read and work with.

2 additional notes:

1) LIKE kind of sucks when used in this way, because the optimizer isn't given the parameter.  Therefore it code generates assuming the parameter could be '%'.  This leads to poor performance.  If you are looking for the first letters in a string, you should use %STARTSWITH like so:

SELECT Child.Name FROM Mother INNER JOIN Child ON Mother.ID = Child.Mother WHERE Mother.Name %STARTSWITH('A%')

That will allow a ranged read of the Name index (which I assume you have) instead of a full scan.

2) If you set these up as a parent-child relationship in your class definition, you should change it to one-to-many or to use foreign keys.  The reason for this has to do with the storage.  Without going into too much detail, if you have a parent-child relationship they are stored on disk together, with each parent very close to its children.  This causes performance problems if you want to look at just the parent information alone, as you'll have to load in the child information, even if you don't need it.  

Currently the only way to give permissions on "Future" tables (that is, tables you haven't created yet) is to grant permissions on the schema and then add tables to that schema.  

Note that when you assign SQL Privileges, you should do so to a Role. The InterSystems security model is such that you grant resources to roles, and roles to users.  SQL Permissions are resources that you should grant to Roles.

Do you understand what a Cross-Origin Resource Sharing (CORS) is?  You can allow CORS requests, but it is important that you understand what you're getting into.  That is, you need to think about it in the context of your application as it effects the accessibility of your data.  So before going too far with this, please think about what changes here might mean.  Some reading materials:

Now, you seem to have this working on one webserver and not another.  Do both webservers point to the same HealthShare instance?  

You can write a function that returns the timestamp of your JSON array, and then SELECT it out like that.   Here's an example:


Class Test.JSONProp extends %Persistent

	Property JSON as %String (MAXLEN=1000);
	Property Type as %String;
ClassMethod GetTimestamp(str as %String) as %TimeStamp [SqlProc]
		s j={}.%FromJSON(str)
	    s ts=j.Biometrics.%Get(0).TimeStamp
	    return ts
	catch err
		return ""

The query then becomes:

SELECT ID,Type,Test.JSONProp_GetTimestamp(JSON) as TS 

Give that a try - you'll need to probably do something different with the JSON depending on your version.

I can get you column 2:

 w stmt.%Metadata.columns.GetAt(2).property.SqlFieldName

but I don't see a way to do this with Implicit JOINS (->).   You can get the table and kind of figure it out with something like this:

w stmt.%Metadata.columns.GetAt(2).property.parent.SqlTableName

w stmt.%Metadata.columns.GetAt(2).property.parent.SqlSchemaName

I think the question here is what are you going for in the bigger picture?  Perhaps there's another angle?

In that case, if you EVER want to query the headers (say, you want information on the dates, which would exist in the header) then you will always be loading the children into memory.  This is clearly inefficient.  

You can enforce each Line having a Header by make the property required, and you can use Foreign Keys to cascade deletes as well.  The only time to use Parent-Child is if you will NEVER query the parents without the children (or the tables are to be so small as the performance hit you take doesn't matter).

Parent-Child is not recommended as a solution here.  Because children are stored in the same global as the parent, any time you want to look at parent information, you necessarily have to load in the child rows into your global buffers. 

In the One-To-Many scenario, both the One and Many side have their own tables, so doing SQL lookups should be easy.