go to post Robert Cemper · Aug 10, 2023 example moved here Remote Global Listing using NativeAPI for ObjectScript #1
go to post Robert Cemper · Aug 9, 2023 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 }
go to post Robert Cemper · Aug 9, 2023 you may run an export ^%G like on the remote server and then copy somehow the result
go to post Robert Cemper · Aug 9, 2023 It's an orgy of IsDefined ($DATA) and GetNext( $ORDER) as equivalent of $QUERY is not implemented
go to post Robert Cemper · Aug 9, 2023 sorry, Insert() is only for the "MANY" side of the Relationship
go to post Robert Cemper · Aug 9, 2023 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)
go to post Robert Cemper · Aug 9, 2023 Relationship is an Object concept that has no direct equivalent in SQL to handle itThe "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
go to post Robert Cemper · Aug 9, 2023 Instead of Set Set objcontato.Trabalho=##class(Contatos.Empresa).%OpenId(IDt) you need to use method Insert()Do objcontato.Trabalho.Insert(##class(Contatos.Empresa).%OpenId(IDt)) See Docs
go to post Robert Cemper · Aug 8, 2023 My 5th Choice: use Native API for ObjectScript for access. especially %Net.DB.Iris
go to post Robert Cemper · Aug 8, 2023 My 4rd Choice: as you have access export the Global to a file copy the file using SSCP
go to post Robert Cemper · Aug 8, 2023 My 3rd Choice: get a network file connection to the source DB mount the DB over the network as remote drive mixing file systems Win / *UX might be tricky
go to post Robert Cemper · Aug 8, 2023 My Second Choice: connect to the server over SQLgateway (Odbc, Jdbc). use Global Dump to SQL
go to post Robert Cemper · Aug 8, 2023 My First Choice: use ECP to mount a Remote DB. copy the Globals
go to post Robert Cemper · Aug 4, 2023 BTW:whatever your method does it always terminate with Quit $$$OKso whatever happens it is equivalent toset SphereJauh=1I assume you look for a different return value ? Is it ?
go to post Robert Cemper · Aug 4, 2023 your ClassMethod GetSphereJauh(Id..... is located in some Class so just call it as any other class methodset SphereJauh=##class(classname).GetSphereJauh(ATTRDesc) the fact that this is used as part of a custom class query is totally irrelevant in this context.it is straightforward ObjectScript. nothing else
go to post Robert Cemper · Jul 31, 2023 Now it is obvious that ^realglobal has 11.3 times the size of ^testglobalwhile your ^testglobal seems to have all blocks in buffers in memorythis is rather unlikely for ^realglobal.So repeated reloading of blocks from disk seems to cause the delayIf you have the chance to double or triple your global buffersyou most likely may see improved processing of your $O()