go to post Robert Cemper · Feb 27, 2018 Hi, Evegeny!for both variants you work along the array by GetNext() methodfor each employee you have an array with the OREFs of the company. So you have the full object at hands.similar the opposite direction from company to employee and employee->nae in SQL or employee.nameAnd as we always have a Collection type Array indexing is simple either by (KEY) or (ELEMENT). whether you need the ID or the OREFhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSQLOPT_indices#GSQLOPT_indices_collectionsThe only tricky action is DELETE: there you have to have a method to "DisRelate" before delete.But real commercial systems never delete anything. Just set a flag "isDeleted". Which is much easier for any "undo" action.
go to post Robert Cemper · Feb 27, 2018 It's a value returned from OS:So this might be platform dependent.the call is $zu(140,5,$select($$$isVMS&&(%file'[";"):%file_";*",1:%file))the part for VMS deletes all versions of the file if the name is not terminated by " ;"
go to post Robert Cemper · Feb 27, 2018 First I would expect Soap.InboundAdapter writes to stream and has no limit.But if longstrings are enabled the MAXsize of a %String is ~3.6 MB. Your description sounds to fit this.You may look at your Adapter where the input goes.But it might be also later processing of a stream to cause the problem.
go to post Robert Cemper · Feb 27, 2018 doc say: classmethod Delete(filename As %String, Output return As %Integer) as %Integer Deletes the file filename. Returns true if it succeeds and false otherwise. Pass return by reference to obtain the low level return value in case of errors so try: set success = file.Delete(File, .return) to see the reason for failing
go to post Robert Cemper · Feb 26, 2018 You look for INSERT from Querydoc is here http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_insert#RSQL_insertselectAs far as I see it should work the way you have written(assuming data types between target and source match) To estimate runtime you may try the select count(*) from VwSrcTable first to get a feelinghow many records that will be. Then during load running Select count(*) from DestTable from a 2nd session may let you see your progress.
go to post Robert Cemper · Feb 26, 2018 pls. post your query in detail.it's not obvious what you try to do.
go to post Robert Cemper · Feb 22, 2018 SQLCODE -99 Privilege violationYou have 3 different sets of access rights in this scenarioyour development user the application userthe user your Caché / ENS server installation is running onCheck if also your server has the required access rights at OS level.under *IX it's quite likely that you don't run as root.(though this happens also on other OS)
go to post Robert Cemper · Feb 22, 2018 OMG CCUCL ! (OhMyGod CamelCaseUpperCaseLetters !).Thanks, @Eduard.Lebedyuk . I never could have guessed it.
go to post Robert Cemper · Feb 21, 2018 It was first documented in 2015.2chapter 12.1.1 p.108http://docs.intersystems.com/documentation/cache/20152/pdfs/GSQL.pdf• Dynamic SQL can accept a literal value input to a query in two ways: input parameters specified at execution timeusing the “?” character, and input host variables (for example, :var) specified at prepare time. Embedded SQL usesinput and output host variables (for example, :var).
go to post Robert Cemper · Feb 21, 2018 An interesting observation!IT WORKS !I just retyped it a little bit extended for fast retry: set minage = 80set myquery = 3set tStatement = ##class(%SQL.Statement).%New()set myquery(1) = "SELECT top 10 %ID AS id, Age , Name, %ODBCOUT(DOB) DOB, Home_State"set myquery(2) = "FROM Sample.Person WHERE Age > :minage"set myquery(3) = "ORDER BY 2"set qStatus = tStatement.%Prepare(.myquery)set tResult = tStatement.%Execute()do tResult.%Display()in SAMPLES:id Age Name DOB Home_State16 82 Schaefer,Alvin S. 1935-05-05 HI108 82 Adams,Brian Q. 1936-02-21 IL199 82 Yeats,Ashley K. 1935-10-28 NC74 83 Ravazzolo,Molly I. 1934-12-31 WV63 84 Cheng,Filomena J. 1933-12-27 NM69 84 Yeats,Patrick U. 1933-04-19 KY92 85 Lepon,Liza M. 1932-06-03 MN94 87 Browne,Patricia I. 1930-04-05 AL111 87 Orlin,Edward J. 1930-04-10 OR197 87 Rogers,Barbara M. 1930-12-06 WIIt also works using traditional %ResultSetThough I didn't interpret nor use it that way it is documented here:Dynamic SQL versus Embedded SQL (4th point)Dynamic SQL can accept a literal value input to a query in two ways:input parameters specified using the “?” character,and input host variables (for example, :var). Embedded SQL uses input and output host variables (for example, :var).
go to post Robert Cemper · Feb 21, 2018 reason #1) 40 yrs. backward compatibility #2) in $LB not everything is a string but has its hidden data types while a string is sequence of bytes an integer get#s a binary representation ( ~ 19 digits ==> 8 byte (int64))try:set x=$lb(64444,"64444") zzdump x04 04 BC FB 07 01 36 34 34 34 34it's really byte saving
go to post Robert Cemper · Feb 20, 2018 In general I would agree:Though in order to use the class query you have the change to namespace "%SYS" and back.As the query is predefined you finally build your own lookup list which is a copy of the original global.Anyhow this would provide the required result: kill roles set roles="" new $namespace zn "%SYS" set rs=##class(%ResultSet).%New("Security.Roles:ListAll1") set tSC=rs.Execute() if tSC { while rs.Next() { set role=rs.Get("Name") write ">",role,! ;; just for display set roles($zcvt(role,"L"))="" } } set rs="" ;; for save return from "%SYS" zw roles ;; for demo set list2=$lfs(input,"CN=") for i=2:1:$LL(list2) { set CN=$p($li(list2,i),",") ;; get 1st piece set CN=$zcvt(CN,"L") ;; lower case required..v set exists=''$d(roles(CN)) write !,i," ",exists," ",CN ;; for debugging and demo if exists write " role found" } quit ;; get back to original namespace
go to post Robert Cemper · Feb 20, 2018 32k sounds like the default size of Read() method in %Stream classes. did you verify with ...stream.SizeGet() ?http://docs.intersystems.com/iris20181/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Stream.FileBinary#Read
go to post Robert Cemper · Feb 19, 2018 for i=2:1:$LL(list2) { set CN=$p($li(list2,i),",") ;get 1st piece set CN=$zcvt(CN,"L") ;lower case required..v set exists=''$d(^|"%SYS"|SYS("Security","RolesD",CN)) write !,i," ",exists," ",CN if exists write " role found"}
go to post Robert Cemper · Feb 19, 2018 so with a little change you get the content of CN= as starting string set list2=$lfs(input,"CN="); ignore trailerfor i=2:1:$LL(list2) write !,i,?5,$p($li(list2,i),",") 2 Access.Ensemble.Developer.User3 [CPD Admin]4 [MUSE_Access]5 [IT eMaterials]
go to post Robert Cemper · Feb 19, 2018 what is this ? a String or a JSON object , or a fixed sequence of (CN= ,OU=, DC=, DC= )there is no obvious groupIng by a separator visible.You may start byset list=$lfs($p($p(input,"{",2),"}"))zw listlist=$lb("CN=Access.Ensemble.Developer.User","OU=Access Groups","DC=OSUMC","DC=EDU"," CN=[CPD Admin]","OU=Distribution Lists","DC=OSUMC","DC=EDU"," CN=[MUSE_Access]","OU=Distribution Lists","DC=OSUMC","DC=EDU"," CN=[IT eMaterials]","OU=Distribution Lists","DC=OSUMC","DC=EDU...") But instead of an unstructured string you have an unstructured list
go to post Robert Cemper · Feb 19, 2018 George, GordonInteresting info on Upgrade2016.1 This seems to by some fake news.Since the class is there om 2017.2 and even in IRIS2018.1http://docs.intersystems.com/iris20181/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25CSP.StreamThe Type set fails because %CSP.Stream is just an abstract class. Like %CSP.Page you have to create the real object yourself as %CSP.CharacterStream or %CSP.BinaryStream a little bit simplified for retyping in terminal:set req = ##class(%CSP.Request).%New()set cont=req.Content zw cont ; MO AUTOMATIC OBJECT BEAUSE ABSTRACT !!cont=""set cont=##class(%CSP.CharacterStream).%New() zw cont ; NOW WE HAVE AN OBJECTcont=<OBJECT REFERENCE>[5@%CSP.CharacterStream]+----------------- general information ---------------| oref value: 5| class name: %CSP.CharacterStream| reference count: 2+----------------- attribute values ------------------| (%Concurrency) = 1| (%LastModified) = ""| %Location = "" <Get,Set>| (%LockRef) = ""| (%Locked) = 0| AtEnd = 0| (Buffer) = ""| (IOSize) = 0| Id = ""| LineTerminator = $c(13,10) <Set>| (MaxNodeNo) = 0| (Mode) = 0| (NodeNo) = 0| (Position) = 1| (StoreNode) = ""| (StoreRoot) = "^CacheStream"| (TempNode) = ""+--------------- calculated references ---------------| CharSet <Get,Set>| ContentType <Get,Set>| Expires <Get,Set>| FileName <Get,Set>| Headers <Get,Set>| LastModified <Get>| MimeSection <Get,Set>| Size <Get>| (StoreGlvn) <Get>| (TempGlvn) <Get>+-----------------------------------------------------set cont.ContentType="application/json"; and so on ....HTH