It was a little bit more complicated than expected. Anyhow take a look
SQL for ^ERROR Global
Thanks to @José Roberto Pereira for the inspiration.
- Log in to post comments
It was a little bit more complicated than expected. Anyhow take a look
SQL for ^ERROR Global
Thanks to @José Roberto Pereira for the inspiration.
in IRIS if the data type is any numeric (%Integer, %Decimal, %Float, ..... or %Boolean) the value is NOT enclosed in Quotes.
Just to outline my understanding:
my package will be rcc.subject.classname
rarely eventually zrcc.subject.classname if it should go to %SYS .
And I will not touch/ rename existing projects as this means changing not just the code
but also README.md , Descriptions in OEX and Articles in DC, Screenshots, Dependencies (not just my own), ...
Over all a good source for mistakes, typos, errrors, confusion,
What is the rule for VERSION in Dependencies ?
Is it an EQUAL or a MINIMUM Version.
e.g. <Version>0.0.0</Version> would mean any version
<Dependencies>
<ModuleReference>
<Name>holefoods</Name>
<Version>0.1.0</Version>
</ModuleReference>
</Dependencies>Thanks !
The so-called SQLformat doesn't exist in Caché (at least not in the last 20 years)
But over the gateway, you can move data from Caché to PostgeSQL. "from a table on CACHE to a POSTGRESQL table"
So you need a trigger to do it:
- Caché has to be the active part here
you can start the upload over a webservice, an REST call, even as an SQLprocedure, or automatically by the scheduler
And if you don't want to touch your target table directly you may have a shadow-copy in PostgreSQL that
then serves as a source for your final updates. ( some INSERT...SELECT....)
So instead of import from CSV, you do an import from a local table in PostgreSQL
Anything is better than CSV.
This would even allow filling your shadow over the day in small steps instead of a big bang (if needed)
There is a JDBC driver to PostgreSQL available.
Using that drive you define an SQL Gateway for your PostgreSQL and establish a link for your tables:
The projection can be accessed as if was a table in Caché.
Details & HowTo here: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_gateway
just tried. the link leads you to :
https://openexchange.intersystems.com/package/Simple-remote-server-control
there is the link to GitHub
You might be inspired by this:
https://community.intersystems.com/post/simple-remote-server-control
In principle, a job is hanging around waiting for orders. Like a cab waiting for a drive.
a little bit cross thinking it reminds me of this
https://community.intersystems.com/post/unlimited-unique-index
I 've never seen the 1000 cols limit. (Consider the record size and the related impact to storage !)
But in a comparable situation, I used an array with the column name as a key. => unlimited columns, slim storage.
And you can work on it in SQL and in classes.
BUT this is object thinking, not straight SQL
try it without "CONSTRAINT TestePK PRIMARY KEY (ID)"
and without "ID INT NOT NULL, "
so you get an autoincremented unique ID by default
This option
https://community.intersystems.com/post/terminal-multi-line-option
or the extended one with editor support
https://community.intersystems.com/post/terminal-multi-line-command-editor
could be useful.
Studio is an integrated part of Caché, Ensemble, IRIS, ... and part of any installation kit for Windows
https://docs.intersystems.com/iris20201/csp/docbook/DocBook.UI.Page.cls?KEY=GSTD
In studio you open the class and click the class attribute in the inspector
.png)
to edit a table by DDL the corresponding class hat to be DDL allowed.
I have implemented an extension to %ZJSON.Generator to fix missing JSONTYPE
Standard Caché data types don't have a parameter JSONTYPE (!!) so everthing is set to (quoted) "string".
Especially numbers and boolean data must not be in quotes.
e.g ....."NUMfield":124, "TrueFalse":true, ....
instead of ....."NUMfield":"124", "TrueFalse":"true", ....
this extension bypasses the missing parameter for these standard data types as indicated in %ZJSON.Adaptor
/// number = %BigInt, %Currency, %Decimal, %Double, %Float, %Integer, %Numeric, %SmallInt, %TinyInt
/// boolean = %Boolean
For customized data classes it is easy to add Parameter JSONTYPE=". . . ."
But changing sometihng in SYSLIB is a clear NO-NO to me. ( though it might have been easier)
The extended version of %ZJSON.Generator is here:
https://github.com/rcemper/Backport-JSON.-to-Cach-/blob/master/MissingJSONTYPE.xml
Great stuff @Vitaliy Serdtsev
https://docs.intersystems.com/iris20192/csp/docbook/Doc.View.cls?KEY=RSQL_json
everlasting learning! ![]()
Got you!
Something like $isJSON() ? like $isobject() or $listvalid()
I didn't meet that.
Basically it's %String or a %Stream based on size.
I'd suggest having a private data type.
This allows you also to have all tricky LogicalToODBC, .... under control. (and no MAXLEN for %String)
And mapping it to %ALL or naming it %ZstringJSON or similar makes it public and update-restistant
Some more findings what happens:
The output methods are code generated. And the generator just uses JSONTYPE from the data type class.
That means that even as the property parameter is available in Studio, ... you can't change it.
example: Property bool as %Boolean (JSONTYPE="string") is just ignored and you see ,"bool":false
This means: JSONTYPE is frozen in the data type class
Bringing Parameter JSONTYPE into the class (e.g, by %ZJSON.Adaptor) has no influence to the Generator
To achieve the expected result you require a customized data class as suggested by @Timothy Leavitt
Out of 25 only these 7 6 classes are affected the rest is string which is default anyhow.
boolean %Library.Boolean.cls(JSONTYPE): Parameter JSONTYPE
number %Library.Currency.cls(JSONTYPE): Parameter JSONTYPE
number %Library.Decimal.cls(JSONTYPE): Parameter JSONTYPE
number %Library.Float.cls(JSONTYPE): Parameter JSONTYPE
number %Library.Integer.cls(JSONTYPE): Parameter JSONTYPE
number %Library.Numeric.cls(JSONTYPE): Parameter JSONTYPE number %Library.PosixTime.cls(JSONTYPE): Parameter JSONTYPE not in Caché
IRIS has added a new parameter in 25 Data Classes:
I'll see the impact as soon as I find free time
With a small extension, you may get closer to your result.
What you expect is a JSON Array, but %JSONExport... works on data OBJECTS, not on data TYPES { same as XMLExport() }
So I have created a small wrapper object:
Class Test.javier Extends (%RegisteredObject, %JSON.Adaptor)
{ Property wrap As Test.elementList(%JSONFIELDNAME = " "); }extending Test.Main:
And here we go:
Just to verify if this is a %JSON specific problem I added also %XML.Adaptor to the classes.
And there is a similar problem: %ListOfObjects seems to be the bad guy.
You use set patientMRN = msgIn.GetValueAt("PID:3.1") and get back a value
the reverse is do msgOut.SetValueAt(patientMRN,"PID:3.1")
in your query, I see "Timestamp" and Timestamp
Check the status of SUPPORT_DELIMITED_IDENTIFIERS parameter
Next check the date type of your column named Timestamp.
easiest SELECT top 5 "Timestamp","Skillset" FROM "dbo"."iSkillsetStat"
also try SELECT Timestamp,Skillset FROM dbo.iSkillsetStat
without any quoted columns
You won the extra points !
It's good to know someone is reading your comments.
THANKS!
Just found an example:
#1)
- create a simple Business Process using the wizard
- compile it and see the resulting class and at least 4 related .int routines.
- then decide if you really want to do this all manually
the challenge is to properly use and service the methods you see in Ens.BusinessProcess
To make it easier you may install (or activate) the ENSDEMO namespace as an example (before IRIS. have no idea where it is gone)
#2)
you write. ---transformation (written in DTL), but the code is manually written. ---
It might sufficient to put your code just into a CODE Block of a BP generated with the wizard.
My personal opinion:
WIN* is a nice Desktop OS good for mom and aunt Betty. With an incredible paranoic approach.
In post VMS times all *X (LinuX,AIX, OS X, Solaris(rip+), ***UNIX, ....) are real server OS systems by nature.
I did this implicitly during my Sharding Evaluation
https://community.intersystems.com/post/sharding-evaluation-1
and more on
https://community.intersystems.com/post/sharding-evaluation-2