go to post Robert Cemper · Feb 1 Try this from %Library.Routine: https://docs.intersystems.com/iris20243/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=%25Library.Routine#Deletewith flag=2 classmethod Delete(rtnname As %String, flag As %String = 0, supressbackup As %Boolean = 0, nsp As %String = $namespace) as %Status Delete the routine rtnname. If the rtnname is not fully qualified we will resolve this into a fully qualified name first and then proceed with the rest of the delete. For example if you specify 'test' and there is a 'test.mac' it will resolve to this, if there was only a 'test.obj' it will resolve the name to this. The parameter flag specifies how much to delete. The options are: 0 - Delete entire routine, for a MAC routine this will delete MAC, INT, OBJ. For an INT routine it will delete INT and OBJ, for a INC routine it will only delete the INC, for a BAS routine it will delete the BAS and the OBJ code. 1 - Delete just the named routine, for example for a MAC routine it will only delete the MAC and it will leave the INT and OBJ if present. 2 - Delete all the source code but leave any OBJ code.
go to post Robert Cemper · Jan 31 this fails with <ILLEGAL VALUE> if time part is negative (before 3AM)
go to post Robert Cemper · Jan 28 I think SQL is correct. The. problem is caused by INSERT or UPDATE for UPDATE NVL takes an existing field from a record and handles NULL for INSERT there is just no existing record to take a field from NVL() is not a synonym for $GET() we know from ObjectScript
go to post Robert Cemper · Jan 23 Take a look into OpenExchange there are 669 packages using DockerWhich means at least 90% of them are running on the latest free Community Versions down loaded.I bet there are enough examples that fit your needs
go to post Robert Cemper · Jan 22 something like this ? | COL | VAL | | ------ | --- | | codRep | 401, 428, 428, 464, 472 | | Abril | 100000, 180000, 160000, 0, 0 | | Agosto | 100000, 350000, 200000, 90000, 0 | then this is the SQL statement SELECT 'codRep' "COL", list($JUSTIFY(codRepresentante,10)) "VAL" FROM Ped.MetasRepresen where ano=2024 Union All SELECT ' Abril', list($JUSTIFY(vendasAbril,10)) FROM Ped.MetasRepresen where ano=2024 Union All SELECT 'Agosto', list($JUSTIFY(vendasAgosto,10)) FROM Ped.MetasRepresen where ano=2024
go to post Robert Cemper · Jan 22 I understand that you want to have full control of your versionIncrement and Decrement eventually also more than just +1,-1so VERSIONPROPERTY is a dead herring.BUT: You can achieve this in combination with a little SQL method. Property RowVer As %Integer [ SqlComputeCode = { if $i({*},$g(%IncDec)) }, SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ]; ClassMethod IncDec(step As %Integer = 0) As %Boolean [ SqlName = IncDec, SqlProc ] { set %IncDec=step quit 1 } Now you can set the increment to any %Integer of your choice.e.g. -1 decrement by 1, 1 increment by 1, 0 leave it How to use it: INSERT OR UPDATE pck.myTable SET name='Omer' WHERE pck.IncDec(-2)=1 AND .... any other conditions .... the IncDec SQLmethod is used as a static methodit doesn't reference any row dependencySo it is executed once before any row related processing. if you omit it then row_version is not changed
go to post Robert Cemper · Jan 22 the posted link is limited to HS licensed users only HERE is an official public link: VERSIONPROPERTYIt does basically the same as my previous SqlComputeOnChange examplehidden and with less typing
go to post Robert Cemper · Jan 21 I feel deeply honored and congratulate all other winning contributors!🌟🌟🌟🌟🌟🌟🌟
go to post Robert Cemper · Jan 21 what you see as \x.... is the hex image of a $LB("SERVERA.FOO.BAR.ORG/STAGE", ......)try ZZDUMP of any $LB() and you see length + type + content\t is the misinterpretation of length x\09my guess it's the hex_dump of some object
go to post Robert Cemper · Jan 21 Calculated doesn't do it.BUT; [ SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ]
go to post Robert Cemper · Jan 20 Yes i! I'm quite sure! DSTIME was introduced with or short after release of DeepSee morethan a decade back and didn't change.
go to post Robert Cemper · Jan 20 you have to add you own RowVersion property.my example only increases the version if there was a any change in the row. Property RowVer As %Integer [ SqlComputeCode = { if $i({*}) }, SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ]; works for SQL- and Object-mode
go to post Robert Cemper · Jan 20 As you refer to CSP combined with a Steam I assumeyou have some similar sequence in you CSP page <p align="center"> <!-- The trick is the use the encrypted oid of the stream as the STREAMOID parameter to the stream server --> <image src="%25CSP.StreamServer.cls?STREAMOID=#(..Encrypt(oid))#"> </p> Docs for StreamServer That's where your stream is dumped to browser
go to post Robert Cemper · Jan 17 Almost 6 years back I wrote and article on data synchronizationUsing DSTIME and a related example in OEX.It is focussed on detecting and optimizing insert, change, delete of specified Tables/Classesand it takes care of processing cycles to avoid duplications.So the output might be minimized.Transmission speed to PostgreSQL is not part of the example
go to post Robert Cemper · Jan 14 like this: /// using $ZZFIX() custom function Class rcc.GetFixZZ Extends %Library.String { Parameter LENGTH As %String = 10; Parameter ALIGN As %String = "LEFT"; Parameter PADCHAR As %String = " "; Method Get() As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","""_$E(%parameter("PADCHAR")_" ",1)_"""" set code=code_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit $ZZFIX(%val,"_code ) QUIT $$$OK } ClassMethod StorageToLogical(%val As %String) As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","""_$E(%parameter("PADCHAR")_" ",1)_"""" set code=code_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit $ZZFIX(%val,"_code ) QUIT $$$OK } }
go to post Robert Cemper · Jan 14 Though, if you need this functionality over multiple namespacesI'd suggest to use a Language Extension:#1 an .inc for the the code definition in namespace %SYS ROUTINE ZZFIX [Type=INC] /// fix length string + padding + l/r-adjustment ZZFIX(%val, len , pad = "", right = 0) if right quit $e($tr($j("",len)," ",$e(pad_" "))_%val,*+1-len,*) quit $e(%val_$tr($j("",len)," ",$E(pad_" ")),1,len) #2 add this line to %ZLANGF00.mac #include ZZFIX after compiling it you may run a test in any namespace USER>set test="213abc" USER>write $ZZFIX(test,10,"*") 213abc**** USER>write $ZZFIX(test,10,"*",1) ****213abc USER>write $zzfix(test,5,"*",1) 13abc USER>write $zzfix(test,15,"$") 213abc$$$$$$$$$ USER>write $zzfix(test,15,"$",1) $$$$$$$$$213abc USER> If available this could of course also replace theClassMethod in the DataType definition.It's a matter of taste.
go to post Robert Cemper · Jan 14 I just felt the need of the last extension to adjust it to reality. A side effect: because of the implementation as Classmethod ClassMethod Fix(%val, rcc, rccp = "", rccal = 0) As %String You can apply it dynamically to any String/Number that you get in hands.(that's how I tested the core functionality)
go to post Robert Cemper · Jan 13 Thank you @Jeffrey Drumm !Yet another idea:Sometimes you may want a static non-blank padding character.e.g. ****123 or 345~~~~this is included as Parameter PADCHAR as %String =" " ; default= blank /// padding other than " " might be useful in some cases Class rcc.GetFixSqlPad Extends %Library.String { Parameter LENGTH As %String = 10; Parameter ALIGN As %String = "LEFT"; Parameter PADCHAR As %String = ""; Method Get() As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","""_$E(%parameter("PADCHAR")_" ",1)_"""" set code=code_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit ##class(rcc.GetFixSqlPad).Fix(%val,"_code ) QUIT $$$OK } ClassMethod StorageToLogical(%val As %String) As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","""_$E(%parameter("PADCHAR")_" ",1)_"""" set code=code_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit ##class(rcc.GetFixSqlPad).Fix(%val,"_code ) QUIT $$$OK } /// PADCHAR=" "; LEFT=0, RIGHT=1 ClassMethod Fix(%val, rcc, rccp = "", rccal = 0) As %String { if rccal{ set %val=$e($tr($j("",rcc)," ",$e(rccp_" "))_%val,*+1-rcc,*) } else { set %val=$e(%val_$tr($j("",rcc)," ",$e(rccp_" ")),1,rcc) } quit %val } }
go to post Robert Cemper · Jan 12 This doesn't work for SQL - Therefore a new version Class rcc.GetFixSql Extends %Library.String { Parameter LENGTH As %String = 10; Parameter ALIGN As %String = "LEFT"; Method Get() As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit ##class(rcc.GetFixSql).Fix(%val,"_code ) QUIT $$$OK } ClassMethod LogicalToDisplay(%val As %String) As %String [ CodeMode = generator, ServerOnly = 0 ] { set code=+%parameter("LENGTH")_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit ##class(rcc.GetFixSql).Fix(%val,"_code ) QUIT $$$OK } ClassMethod LogicalToOdbc(%val As %String) As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit ##class(rcc.GetFixSql).Fix(%val,"_code ) QUIT $$$OK } // only required for SQL Display Logical mode ! ClassMethod StorageToLogical(%val As %String) As %String [ CodeMode = generator, ServerOnly = 1 ] { set code=+%parameter("LENGTH")_","_("RIGHT"=$zcvt(%parameter("ALIGN"),"U"))_")" $$$GENERATE(" quit ##class(rcc.GetFixSql).Fix(%val,"_code ) QUIT $$$OK } /// LEFT=0, RIGHT=1 ClassMethod Fix(%val, rcc, rccal = 0) As %String { if rccal{ set %val=$e($j(%val,rcc),*+1-rcc,*) } else { set %val=$e(%val_$j("",rcc),1,rcc) } quit %val } }