Caché

Hello,

 

I try to open an existing log file and append to it. In Windows I use Open file:(NRW):1. I would expect it to append to the file, but each time I execute the code I get only the new entries, the prior file content is lost.

 

What is the proper syntax top open a file in "Append" mode?

 

I will deploy this code in Linux. Is there a different syntax to open a file in Linux versus Windows?

 

Thanks,

 

Oliver Wilms

Last answer 1 July 2019
0   0 1
0

comments

160

views

0

rating

Hi Dev Community,

My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.

The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:

Last answer 1 July 2019 Last comment 17 June 2019
0   1 4
316

views

0

rating

Hello everyone,

Anyone can help me please. We use SOAP web service with public methods and have many instances of these classes, all work fine. We would like to create a new SOAP web service but for internal usage only, meaning not available to the public. The purpose of this is for communication between different servers internally.

We thought of having the methods to be Internal, WebMethod instead of just WebMethod.

Any suggestions?

Regards

Ben

Last answer 1 July 2019
0   1 2
0

comments

126

views

0

rating

Hi 

Quick question... Is it possible to save a class in another namespace. If you're saving a global you can just use an extended reference, but is it possible to achieve the same when saving a class object?  Obviously the class will be defined in the other namespaces too.

I want to do it from an Ensemble SOAP Service. I guess you could switch namespaces, but I was a bit worried about doing that from Ensemble process.

thanks

 

Last answer 28 June 2019 Last comment 28 June 2019
+ 1   0 3
170

views

+ 1

rating

Hello,

Working on to learn very basic CUSTOM Business Service which sends to a EnsLib.File.PassthroughOperation.

But operation is not writing to File and erroring out (No Stream contained in StreamContainer Request")'.

How do convert the object to STREAM and wrap in the StreamContainer so the operation does not error and write to a file.

Thanks.

Persistent Class

Last answer 26 June 2019 Last comment 28 June 2019
0   0 3
181

views

0

rating

Hi,

We have a function that takes two parameters, the second one is for output value:

MyFunc(Param1,Param2)

 S Param2="it's all good"

Q 1

 

How can we detect if the caller called the function with one, or two arguments?

Meaning,  how to distinguish this call:

S Result=$$MyFunc(1)

from this call:

S Result=$$MyFunc(1,.OutVal)

 

Thanks!

Nael

Last answer 27 June 2019 Last comment 27 June 2019
0   0 1
175

views

0

rating

If you know the path of a file that exists in the instance's install directory, how can that file be opened and edited in Studio? This file is not saved under the visible directories in Studio ex csp or mgr. For example if you have no access to the server operating system command line, how would you be able to modify a file using Studio?

Last answer 20 June 2019 Last comment 20 June 2019
0   1 3
189

views

0

rating

Forgive my lack of understanding, but I am working on a vendor created Cache database and the indexes specified in the classes for ODBC connections are not working. A few of them are created, but of the 50+ classes we have, only a handful of them are created when the class is compiled, yet no errors occur.

Example 1:

 

Example 2:

 

Last answer 31 May 2019 Last comment 18 June 2019
0   0 3
209

views

0

rating

Hi guys,

I have never used regular expressions with caché object script before, so I've read through the documentation, but I am struggling with things that I'd like some help on.

My need is to identify specific html tags and transform them out to something else. Example:

I need to identify those guys in a wider string:
"<span style=\""font-family: '';font-weight: bold;\"" >BOLD TEXT</span>"
"<span font-style:italic;\" >ITALIC TEXT</span>"

Last answer 17 June 2019 Last comment 17 June 2019
0   0 1
242

views

0

rating

Noticed some unexpected behavior when using $ZTH

Resultant values less than 1 are treated as strings and values >=1 are numbers.  Causing heartburn in $Query / $Next / $Order loops. Is there a setting somewhere that can change this?

Example:

// Parse the time out of a text string whose format is YYYYMMDDHHMMSSsssssssss   (lower case s = fractional parts)

Set MsgDT = "20180405000000001005933"
Set MsgDTH = $ZTH(($E(MsgDT,9,10)_":"_$E(MsgDT,11,12)_":"_$E(MsgDT,13,14)_"."_$E(MsgDT,15,23)),1)

//Do it again, but add a sec to the time string 

Last answer 15 June 2019 Last comment 17 June 2019
0   1 3
234

views

0

rating

I am trying to pull the word count from Microsoft Word document into Cache. Is there anyway to get the values of the extended file properties without opening the word document?  If I right click on a word document (Word does not need to be installed) I can see the additional properties that I want to reference however don't know how to access these without calling out to VBA or poweshell.

 

 

Last answer 14 June 2019 Last comment 17 June 2019
0   0 2
129

views

0

rating

Have enabled LDAP for our numerous , Ensemble, IRIS and cache instances with many namespaces. All is working fine and the ldap logins work.

But have noticed that the first instance that the user logs into the namespace is assigned to that user, but when that user than logs into another instance the default namespace from the first login is still there and doesn't update to the new namespace.

So this doesn't effect the ldap login but is now effecting the terminal logins where the user is now getting access denied.

Last answer 14 June 2019
0   0 3
0

comments

89

views

0

rating

I have several business operations that are all pointed to the same http server. Is there a way to set the http server within some sort of properties file or within the objectscript code? I want to be able to set the http server setting once rather than for every business operation. Any advice on how to go about doing this would be appreciated.

Last answer 13 June 2019
0   0 3
0

comments

79

views

0

rating

I have a custom process that is parsing HL7 and inserting it into a table. Periodically the inserts fail with # due to error: ERROR #5803: Failed to acquire exclusive lock on instance of.... 

Traditional databases would wait until the lock is removed then do the insert, but cache fails. I'm sure it's my coding approach.

How can I work around this? A Try/Catch loop?

Thanks in advance.

Last answer 6 June 2019 Last comment 6 June 2019
0   0 4
188

views

0

rating

I have one persistent, xml-enabled class.
I need to convert objects of this class to XML.
However I need to project each object in different ways (depending on
where I send it), for example:

  • Different list of attributes are projected
  • Attributes have different names
  • ...

Is there a way to do that with XML Adaptor?

Last answer 7 June 2019
0   0 2
0

comments

83

views

0

rating

Hello,

I assume there is a simple explanation for this, but I do get <OBJECT DISPATCH> error, when I am trying to set a global to a value.

My example is huge, but I reproduced it using Samples namespace:  

First I delete the Title from ##class(Cinema.Film)  - 3 

Secondly:

SAMPLES>s ref=##class(Cinema.Film).%OpenId(3)
SAMPLES>w ref.Title

SAMPLES>set ^AK(1)=$G(ref.Title)

SET ^AK(1)=$G(ref.Title)
^
<OBJECT DISPATCH> *Property 'Title' in class 'Cinema.Film' must be MultiDimensional

Last answer 4 June 2019 Last comment 6 June 2019
0   0 2
148

views

0

rating

Hello all,

I have a Recordset object  which contains data from a table "XYZ". 

Currently i use this object to extract data using  %Get(COL1,COL2...) in a loop and than pass it to a function which inserts the data into another dynamically created  Table "ABC"  for each record. This takes a lot of time when 100's of records.

Is there a way i can directly copy a RecordSet to a dynamic table without looping through..?

Something like copy Recordset (COL1,COL2..)--> "ABC"

Thanks,

Jimmy

Last answer 3 June 2019 Last comment 3 June 2019
0   0 2
145

views

0

rating