Robert Cemper · Apr 6, 2023 go to post

instead of %File, I'd suggest to use %Stream.FileCharacter
it has a method MoveToEnd()  that's what might solve your append issue
more

Robert Cemper · Apr 1, 2023 go to post

if Sifra is the IDKEY of Material what is the difference
between Material (which is the ID already) and Material->Sifra  ???

Robert Cemper · Apr 1, 2023 go to post

While %FromJSON() accepts a String or a character Stream as Input
you have in IRIS also %FromJSONFile() that allows direct input from file
and shortcuts the creation of a Stream.
But for both cases take care of encoding  (I'm burned)
​​​​​​​NOTE: RFC 7159 specifies that the default encoding for JSON values uses UTF-8

Robert Cemper · Mar 30, 2023 go to post

SQL type TEXT maps correctly to %Stream.GlobalCharacter,
- anyhow this gets not granted on the way from ADO to IRIS-

it would be useful to check if the behavior is the same with a normal ODBC tool.
I tested recently the opposite direction from IRIS to WinSQL and that was OK.
Since transmitting streams always requires some chopping and assembling
at both ends not to break the buffers, it is important if the error persists outside ADO.

Robert Cemper · Mar 30, 2023 go to post

just a minor part:
Is it possible while sending an insert/Update to database via the ado driver for iris, that this SQL is executed without creating a cached query?
NO:
In IRIS and also the latest of Caché / Ensemble every query is cached. 
real non-cached queries date back by ~ 10 years. It wasn't just that visible.
 
As you describe it, it seems the LONGVARCHAR or LONGVARBINARY
are not honored correctly when coming from ADO.

pls. Check the related class definition.
And be aware that once created as VARCHAR it can't be changed  
dynamically to LONGVARCHAR  on the fly. This type is a static definition.

Robert Cemper · Mar 28, 2023 go to post

I see you disliked my previous reply and retitled your article.
so again:

Could be, I misunderstand the purpose of the example.
Before LOAD DATA was available with IRIS this was the still valid approach

  • I opened my CSV in EXCEL
  • Connected by the EXCEL DSN over SQL Gateway using ODBC
  • and did the import.
  • %XML.Adaptor does the rest. If required at all.

And was done before my breakfast coffee became even lukewarm.
And not a single line of code was required!

Sorry, where is the advantage?

And personally, I prefer to work with well trained qualified engineers
instead of a guess & try a program somewhere whether for Py or COS or anything else.
 

Robert Cemper · Mar 27, 2023 go to post

I would like to see this as an important and useful Tutorial!

And definitely more useful than copying the use of Class queries 3 times at least.
 

Robert Cemper · Mar 27, 2023 go to post

if you take a look to method ##class(EnsLib.HL7.Segment).getAtFromArray(...)
you see that the segment data is assembled in row 1008 of the class by  Set data=data_value 
without checking the size.
So it is designed to fail with large documents as your Base64 encoded PDF (~+33% of original)
So just using a reference to an external stored file as you suggested should work. 

 

BTW datatype %VarString is just a shortcut of %String(MAXLEN="") and a sometimes appropriate SQLTYPE.
 

Robert Cemper · Mar 19, 2023 go to post

Oh Dear!

but Memory was expensive.
But my first DSM-like OS on VAX was only ~ 80KB code at run time. (40+ years back)
All the rest for Partitions and Buffers,  . 

Robert Cemper · Mar 18, 2023 go to post

Fully with you.
But in migration, you have no choice.
With several thousands of Globals, there is no chance to find out
if some crazy chap had used it decades ago.
When I saw it the first time I must have looked like Kong Kong.
 

Robert Cemper · Mar 17, 2023 go to post

Does it work if you call your class with full reference? I mean not for Login?
NOT found is suspicious somehow

Robert Cemper · Mar 17, 2023 go to post

Another idea:
Just to see that the port is open and you are on IRIS  you may try to access
over ODBC/JDBC gateway any table in %SYS

Robert Cemper · Mar 17, 2023 go to post

if you insist on that line you need

Set Jsonobj="{""Doctype"":""ADT^A01"",""PatientId"":""123"",""PatientName"":""Alex""}"

Robert Cemper · Mar 17, 2023 go to post

by using {}  your Jsonobj is already a  %Library.DynamicObject
USER> ZWRITE Jsonobj
Jsonobj=<OBJECT REFERENCE>[1@%Library.DynamicObject]
no need for 
Set Dynjsonobj=##class(%Library.DynamicObject).%FromJSON(Jsonobj)

Robert Cemper · Mar 16, 2023 go to post

You are correct it is working inside docker in the container.
But I asked for the external real IP of my (Windows) Host.
I know that is wrong for my purpose,  as I sit just in front of it
and use it some 100 times daily. So I really know it.

It's an odd situation: IRIS -> Ubuntu in container -> Docker -> WSL -> Windows.
I didn't add NAT and Port mapping used by Windows. 

Robert Cemper · Mar 16, 2023 go to post

I did the test, but it failed.
 

C:\GitHub\_my\SSH-for-IRIS-container>docker-compose exec iris iris session iris

Node: f386a88482f2, Instance: IRIS
USER>Set ip = $SYSTEM.INetInfo.HostNameToAddr("host.docker.internal")
USER>zw ip
ip="192.168.65.2"

The correct IP = 192.168.0.9
it's also not the IP-Address of WSL-2 shell  172.21.225.243
It's not even in the DHCP range of my router, nor in the WLAN range
Sorry
BUT: this is an excellent use case for my recent Proposal

Robert Cemper · Mar 15, 2023 go to post

Hi @Iryna Mykhailova and welcome to the Tutorials Contest.
I was waiting for you.
I feel honored that you took the same subject as me %QUERY (officially  Class Query)
In addition, I appreciate that you confirmed by your screenshots, my statement that
the Studio wizard is the most comfortable way to start with the subject. 

The idea to simulate a virtual table is a very nice idea. 
But there is a point in your example that I don't understand:

  • ClassMethod GetAllOlderThanExecute(ByRef qHandle As %Binary, Age As %Integer = 65)  
  • But in ClassMethod GetAllOlderThanFetch(.....)  you don't have it anymore
    and don't use it and display ALL generated records independent of Age

Did I miss something? 

Robert Cemper · Mar 15, 2023 go to post

I found an acceptable workaround.

  • installed telnetd into the container and started it
  • mapped some external port to port 23
  • set this external port  in my cube
  • started the IRIS Terminal
  • BINGO !

You may raise all concerns on Security and Container Isolation.  Accepted! And ignored!
Since THIS solves my issues on optical verification of the user interface.