I used it recently in my post on NativeAPI for ObjectScript
- Log in to post comments
I used it recently in my post on NativeAPI for ObjectScript
Hi @Lorenzo Scalese
I guess you are looking for class(%Utility).FormatString()
USER>set lb=$lb(1,"Lorenzo",2023,"RCC"_$c(13,10))
USER>write lb
LorenzoçRCC
USER>zzdump lb
0000: 03 04 01 09 01 4C 6F 72 65 6E 7A 6F 04 04 E7 07 .....Lorenzo..ç.
0010: 07 01 52 43 43 0D 0A ..RCC..
;;;;; this is it
USER>set viewlb=##class(%Utility).FormatString(lb)
USER>write viewlb
$lb(1,"Lorenzo",2023,"RCC"_$c(13,10))
USER>zwrite viewlb
viewlb="$lb(1,""Lorenzo"",2023,""RCC""_$c(13,10))"Objectscript uses double quotes for strings.
Single quote is Negation
'Sample Data looks for variable Sample >>> NOT Sample
Totally correct.
This is what the example describes:
and the consequence is that you have to spin through ALL GetOrgUpdatesResponse objects
A less impressive design.
So you need to add an index on the ELEMENTS of your Property Organizations
to find all affected objects.
some example of how to
in this case store it in +$HOROLOG format as explained
and leave the conversion to YYYY-MM-DDT00:00:00Z to output
using
+$h stands for your property DOB as %Date
Your transformation produces a YYYY-MM-DD HH:mm:SS string
in contradiction
Property DOB As %Date; expects an Integer similar to +$h
The error is reported during Validation before %Save() of your record
/// example of an extra light output to CSV
Class dc.SQLExport Extends %CSP.Page
{
ClassMethod content() As %Status
{
set sep=";"
set sqlStatement="SELECT ...... FROM ....."
,query = ##class(%ResultSet).%New()
,sc = query.Prepare(sqlStatement)
set:sc sc=query.Execute()
quit:'sc sc
set cols=query.GetColumnCount()
for col=1:1:cols { if col>1 write sep
write query.GetColumnHeader(col)
}
write !
while query.Next() {
for col=1:1:cols { if col>1 write sep
write query.GetData(col)
}
write !
}
quit $$$OK
}
/// filename should end with ".csv"
ClassMethod toFile(filename As %String) As %Status
{
open filename:"WNS":1
else quit $system.Status.Error(5005,filename)
use filename
set sc=..content()
close filename
quit sc
}
}much better than CPIPE
Merci !
You OTHER thought is supported by CPIPE
see Execute Server Commands from Caché / Ensemble / IRIS
Here is a working simple example to start with
https://community.intersystems.com/post/download-globals-xml-using-csp
with an OEX package
add this line to your method OnPreHTTP()
set %response.Headers("Content-Disposition")="attachment; filename=""your-file-name.some"""good point:
there are only 17 rules referring to BUGS:
In total the quality check shows 106 rules.png)
So there is more and I personally deeply disagree with some of them
Not a ready-to-use solution, but a way to take
With JOB you start an independent process in background.
You can pass any variable you may need.
But you can't pass the connection to the CSP page with all its settings.
the connection stays with the foreground job.
there is a standard utility %ETN that writes such logs with the stack
and all other $system variables into the global ERRORs
if you call it by LOG^%ETN it does a kind of snapshot
details here take a look
some formatting of output was applied
😒😟
Are community images from intersystemsdc/ also affected ?
example moved here Remote Global Listing using NativeAPI for ObjectScript #1
my personal congratulations to the Winners ! 👍
According to class Class Contatos.Amiguinho you presented
Class Contatos.Empresa should look similar to this to work:
Class Contatos.Empresa Extends %Persistent
{
Relationship Nomedaempresa As
Contatos.Amiguinho [ Cardinality = many, Inverse = Trabalho ];
Property Nome As %String;
Storage Default
}It also needs an ID and a Relationship.
you may run an export ^%G like on the remote server and then copy somehow the result
It's an orgy of IsDefined ($DATA) and GetNext( $ORDER) as equivalent of $QUERY is not implemented
sorry, Insert() is only for the "MANY" side of the Relationship
You just can insert existing IDs.
So you have to check first:
set emp=##class(Contatos.Empresa).%OpenId(IDt)
if $isObject(emp) Do objcontato.Trabalho.Insert(emp)
Relationship is an Object concept that has no direct equivalent in SQL to handle it
The "MANY" end is basically just a piece of code ( RelationshipObject) to handle it.
By SQL you just can set it indirectly from the "ONE" end as you found yourself.
This is a real Property / Column that has a distinct value that you can touch and set
My 5th Choice: