go to post Robert Cemper · May 8, 2018 I just can guess for possible reasons- dependencies in parallel compiling - some kind of complex or circular "CompileAfter" constructs those things often vanish at 2nd compile with freshly loaded classes. (Hard to reproduce.)
go to post Robert Cemper · May 7, 2018 I finally got the code to compile with no errors.When I run it, the code will insert a row in the table "global" in cache.However, it isn't inserting the information in the external database.From what you describe you have generated a Local Tableas there is a GLOBAL and you write to your local DB. As you have seen.If you use Link Table Wizzard to create it, then there is just no global.The correctly generated class looks similar to this: /// Generated by the Link Table wizard on 2018-05-07 23:20:46.Note that you can access the data in this class only when the external database is accessible.Class GTY.Person Extends %Library.Persistent [. . . . , StorageStrategy = GSQLStorage ] {/// Specifies details for the SQL Gateway Connection that this class usesParameter CONNECTION = ". . . . . . ,NOCREATE";....... Storage GSQLStorage{<StreamLocation>^####S</StreamLocation><Type>%CacheSQLStorage</Type>}}If you do not see the bolded text in your class,it is not generated by Link Table Wizard andyou are in the wrong Class / Table with no access to he external table.
go to post Robert Cemper · May 7, 2018 only 1 .int in %SYS uses "oops:" MIRRORCOMM.int(2845): if $zb(+$SYSTEM.Mirror.DebugFlags(),1,1) do $zu(9,"","oops: jrn.log has incorrect entry, exp("_newpath_") logentry("_jrnfname_"), file num-"_mirfilecnt) could be an indicator to some MIRROR issue
go to post Robert Cemper · May 7, 2018 Could it be there was some Tune Table running that saves its statistic in Storage part of Class ?BTW. oops is really new style
go to post Robert Cemper · May 7, 2018 2 steps:create the new table EMS.BASICINSERT INTO EMS.BASIC (Name,DOB,Gender) Select Name,DOB,Gender from EMS.EMS
go to post Robert Cemper · May 7, 2018 There is a bunch of useful articles you find here searching for CSV.I just picked one out of them: https://community.intersystems.com/post/how-read-csv-file-contents-objects-cacheIn a Windows environment, you may also use an ODBC driver (DSN) and handleExcel as what it is: As a Table using the SQLgateway as you would to with other DBsYou just have to take care to get the bits matching (32/64). More details:https://support.office.com/en-us/article/overview-of-connecting-to-importing-data-c0ad7aec-ff1a-4e48-9c21-dc18a102433f
go to post Robert Cemper · May 4, 2018 Yes. Connect to Mirror using SQLgateway.Link Procedure And then just to a SELECT or CALL.The code has, of course, to be prepared already on Mirror.
go to post Robert Cemper · May 3, 2018 as Jeff mentioned: the Shadowed DB is Read Only.Execution of some code in a remote instance of Caché is independent of Mirror or notEither pack your code (or its call) into a ClassMethod with a return value.mark the Method as [SqlProc ]trigger it by SELECT my.procedure()Or wrap it into some WebService ( REST, SOAP) and execute it that way.
go to post Robert Cemper · May 3, 2018 if ever this should be of practical usethen I'd suggest to move such a "everybody's darling" routine to %SYS and name it %zYJM
go to post Robert Cemper · May 3, 2018 I agree and have suffered over years.I think for Caché and its derivates it's somewhat late in the life cycle.Eventually with iris ? Should be worth an enhancement request
go to post Robert Cemper · May 1, 2018 Great!SAMPLES>w !! do $system.OBJ.ExportUDL("Sample.Company.cls")/// This sample persistent class represents a company.<br>Class Sample.Company Extends (%Persistent, %Populate, %XML.Adaptor){/// Define an index for <property>Name</property>.Index NameIdx On Name [ Type = index ];/// Define a unique index for <property>TaxID</property>.Index TaxIDIdx On TaxID [ Type = index, Unique ];/// The company's name.Property Name As %String(MAXLEN = 80, POPSPEC = "Company()") [ Required ];/// The company's mission statement.Property Mission As %String(MAXLEN = 200, POPSPEC = "Mission()");/// The unique Tax ID number for the company.Property TaxID As %String [ Required ];/// The last reported revenue for the company.Property Revenue As %Integer;/// The <class>Employee</class> objects associated with this <class>Company</class>.Relationship Employees As Employee [ Cardinality = many, Inverse = Company ];------<skip rest> -------
go to post Robert Cemper · Apr 30, 2018 Thank you Tim!You finally gave me a hint why to use [ ProcedureBlock = 0] or [PublicList = (x1, x2) ]as a Method_Parameter. I never saw serious reasons for it.
go to post Robert Cemper · Apr 30, 2018 and BTW, what's dynamic about it?do you mean an array x(Counter) ????
go to post Robert Cemper · Apr 30, 2018 underscore (_) is not allowed in variable nameshttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_appx_identifiers_cos_localvarseventually, you mean set @("x"_Counter) = DIAGSXECUTE ("set x"_Counter_"="""_DIAGS_"""") should work too
go to post Robert Cemper · Apr 27, 2018 no need to excuse.the wording (and help text) sometimes not really guiding.but you motivated me to use more screenshot for explanations.
go to post Robert Cemper · Apr 27, 2018 to access remote tables you should use LInk Table to work in both directionsI wrote this already in line 2 of my answer to this question 2 weeks agohttps://community.intersystems.com/post/cache-sql-insert-external-database##node-446881
go to post Robert Cemper · Apr 27, 2018 you remind me the joke about hieroglyphs:- What's wrong with them?- Nothing! Priests in old Egypt were reading the "book of death" like you would read a newspaper.- You just have to learn the 'encryption'.
go to post Robert Cemper · Apr 27, 2018 Thanks for the clarification.It's sometimes hard to guess the picture if you miss some pixels.I'd still recommend moving the CLOSE after each inner loop to have OPEN / CLOSE strictly pairedThe implicit CLOSE happens only if you exit the partition. There's no class to act undercover. Curly braces just structure the code with no operational side effect.
go to post Robert Cemper · Apr 27, 2018 It seems you have manually changed the class definition.A normal RegisterdObject has no storage definition.from <Type>%Library.CacheStorage</Type> i see it was a %Rersitent before.Storage Default{<Data name="EOBListDefaultData"><Subscript>"EOBList"</Subscript><Value name="1"><Value>EOBList</Value></Value></Data><DefaultData>EOBListDefaultData</DefaultData><Type>%Library.CacheStorage</Type>}remove Storage and recompile.