go to post Robert Cemper · Jun 4, 2019 Docs of $G say variable A local variable, global variable, or process-private global variable, subscripted or unsubscripted. The variable may be undefined. variable may be specified as a multidimensional object property with the syntax obj.property. similar Docs of $D say variable The variable whose status is to be checked. A local or global variable, subscripted or unsubscripted. The variable may be undefined. You cannot specify a simple object property reference as variable; you can specify a multidimensional property reference as variable with the syntax obj.property. but Title in your case is $li(^CinemaooFilmD(3),1). So neither $G() nor $D() is approriate.
go to post Robert Cemper · Jun 4, 2019 misunderstanding:I suggested to just use that EXAMPLE method to write a HTML structured table.Variation is in the SQL statement that you pass to it ClassMethod any(sqlStatement as %string) As %Status { set query = ##class(%ResultSet).%New() , sc = query.Prepare(sqlStatement) ...... }
go to post Robert Cemper · Jun 3, 2019 In docs you find Persistent Objects and Caché SQLespecially storage definitionsFor more information on the globals used for persistent classes, see “Globals.”
go to post Robert Cemper · Jun 3, 2019 some dirty trick to copy across namespace boundaries:have a target class config but change the global references in STORAGE section from^Package.ClassD and ^Package.ClassI to ^|"namespace"|Package.ClassD and ^|"namespace"|Package.ClassIMight be a different way to work across namespaces
go to post Robert Cemper · Jun 3, 2019 Assuming you get the call string as the variable parameter then for par="SERVER","PORT","NAMESPACE" set @par=$P($P(parameter,par_"=",2),":") zw @par SERVER="127.0.0.1" PORT=1972 NAMESPACE="SAMPLES"
go to post Robert Cemper · Jun 3, 2019 Sorry you didn't publish the definition of color .so assuming it is a $LB( ) structure $LISTTOSTRING(color,',') may cover your needs. It's an SQLFUNCTION too!just LIST(color) is wrong as it produces a comma-separated list of MULTIPLE records.
go to post Robert Cemper · Jun 2, 2019 you can delete the class in Studio or from SMPortal.so you delete the class DEFINITION and the related table DEFINITION. but no data.BUT.DROP TABLE in SQL also deletes the data AND the definition because this is part of SQL Standard. (Se also MySQL)I'd suggest you take some time to really read the documentation or consume some online training.
go to post Robert Cemper · Jun 1, 2019 " In MySQL, a "view" is just a saved SQL query - dropping a view does not drop data. I never imagined dropping the class (which I thought was just a view) would empty the global. The global was still there, but all the data was gone. "Caché is different from MySQL but has also VIEWS and dropping a View doesn't touch any DataBut identical as in MySQL DROP TABLE deletes the data.from http://www.mysqltutorial.org/mysql-drop-tableThe DROP TABLE statement removes a table and its data permanently from the database. and this was your question:So how else do I drop the table?and later: I did one by DDL
go to post Robert Cemper · Jun 1, 2019 if you use DROP without option %NODELDATA your data are gone. https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_droptableShort Caché Basics:all data are stored in globals, nowhere elseclasses describe the structure how data are stored and can be accessed as Objects or Tables. classes never change, generate or delete data, but provide methods to do so.so having 3 'tables' on the same global is just having 3 views of the same house.Recommend readings: Long Caché Basics and Introduction to Caché SQL
go to post Robert Cemper · Jun 1, 2019 IF you have seen the "Light weight Excel" and its Open Exchange Repositorythen all you have to do is- open your file - use your fileexecute OnPage method (from example or your personal variation of it)- close your fileBINGO!to make it easier the referred method here: ClassMethod OnPage() As %Status { set sqlStatement="SELECT TOP 23 ID,Name,%ODBCOUT(DOB) DOB,SSN FROM Sample.Person" ,query = ##class(%ResultSet).%New() ,sc = query.Prepare(sqlStatement) set:sc sc=query.Execute() quit:'sc sc set cols=query.GetColumnCount() write "<table border=1>",!,"<tr>" for col=1:1:cols { write "<th align=left><b>"_query.GetColumnHeader(col)_"</b></th>" } while query.Next() { write "</tr>",!,"<tr>" for col=1:1:cols { write "<td>"_query.GetData(col)_"</td>" } } write "</tr>",!,"</table>" quit $$$OK }
go to post Robert Cemper · May 31, 2019 OK. I experienced that scenario quite often. Suggestion to verify that indices will help you.- Take a typical class definition, make a copy without storage definition (or remove it)- compile it with Chaché Default storage and run INSERT INTO new.table SELECT * from old.table a flat table scan- verify the new table against your needs. - if it fits then the problem has moved to "update frequency" which might be easier to solve.It's, of course, limited to the critical tables and not the whole DB
go to post Robert Cemper · May 31, 2019 In your case, you have to KILL the underlying globals manually.As seen in Storage definitioneg. <Global>^SVK</Global> and all others too that you didn't publishWhat I've seen so far DDL enabling might not fit your expectations because of that ancient mapping.(looks like late 80ties or before)
go to post Robert Cemper · May 31, 2019 You shouldn't be so much concerned on looping the RecordSetINSERT ...... SELECT .... looks smaller and smarter but does basically the same
go to post Robert Cemper · May 31, 2019 Well the code you posted shows a rather ancient type of table mapping away from standards.And the errors you got underlines this as standard methods like %BuildIndices and %PurgeiIndices are not implemented.I see 3 possible options:- you find in the code (not necessarily in the class definition) some method to (re) generate the indices. Without experience with Caché and Object Script a rather impossible task.- you create a copy of the class definition and move all data there by INSERT INTO new.table SELECT * from old.tablebut it is unclear from what you showed to us if INSERT into your table is supported at all - least risky. you out-comment all broken indices except [IDKEY] and just use a flat table scan.this is a fast workaround at the price of a poor performance on bigger tables.honestly. - not a funny situation
go to post Robert Cemper · May 31, 2019 You gave the answer already!By compilation, you DEFINE indexes at their rules.But you need to generate their content separately by ClassMethod %BuildIndices in each class.Or from management portal. Then they are ready to use.
go to post Robert Cemper · May 31, 2019 There is another way directly with SQL First, you CREATE a temporary table according to your needs (or have it ready) CREATE GLOBAL TEMPORARY TABLE MyTemp.Table temp1, temp2, . . . . . Next, you fill it by INSERT directly from SELECT INSERT INTO MyTemp.Table (temp1,Temp2, . . .) SELECT COL1,COL2, ... FROM Source.Table WHERE ...... The select is the same as before.
go to post Robert Cemper · May 30, 2019 give your anchor tag an ID and modify it using some JS script.or use %ZEN.Auxiliary.locatorLink or any other element that allows a HREF.or trigger it with JS from any onclick event or similar. It's not much ZEN but pure JS
go to post Robert Cemper · May 30, 2019 Hola Francisco !Málaga is a splendid place. I was there several times privately (with all related sightseeing) and on business.Always a great experience! I wish my Spanish (reading) was not so rusted to assist in tranlsation of articles.especially this one Uso de expresiones regulares en ObjectScriptBienvenido, Robert
go to post Robert Cemper · May 27, 2019 Independent of the way how your servers are linked It might be the easiest to have SOAP service to call each other passing the lab episode number '1119102928' as a parameter.If a lock exists it will be removed. if not nothing happens.Studio has an easy to use SOAP wizard to create the Server and Client part.
go to post Robert Cemper · May 24, 2019 Francisco,instead of FOR EACH which obviously uses a nonexisting Next methodyou could create a loop using <WHILE> and do a "manual" loop.For the condition source.retorno.datos.polizas.poliza.%Size() gives you the index limitand source.retorno.datos.polizas.poliza.%Get(idx).sucursal .... and similar provides the content. You have to increment idx manually and it runs from 0 (zero!) to %Size()-1It's not as elegant as <foreach> but you have control over your JSON input.